Quantcast
Channel: AvalonDock
Viewing all articles
Browse latest Browse all 2690

New Post: Combination with Microsoft WPF Ribbon Control

$
0
0
Hi i also faced this issue. I tried to use the above given xaml but could not get it to work. Can you tell me what am i missing here.

<Fluent:RibbonWindow x:Class="AvalonDockMVVM.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:AvalonDockMVVM"
    xmlns:v="clr-namespace:AvalonDockMVVM.View"
    xmlns:vm="clr-namespace:AvalonDockMVVM.ViewModel"
    xmlns:dock="http://schemas.xceed.com/wpf/xaml/avalondock"
    xmlns:dockctrl="clr-namespace:Xceed.Wpf.AvalonDock.Controls;assembly=Xceed.Wpf.AvalonDock"        
    xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
    Title="MainWindow" Background="White" Height="500" Width="600">

<Window.Resources>
    <vm:ValidSizeConverter x:Key="Conv"/>
</Window.Resources>


<DockPanel x:Name="baseDockPanel">

    <Fluent:Ribbon x:Name="Ribbon" AutomaticStateManagement="True" DockPanel.Dock="Top"
               Title="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=Title}">

        <Fluent:RibbonTabItem  >

        <Fluent:RibbonTabItem.Header>
            <TextBlock Text="Groceries">
                <TextBlock.Style>
                    <Style>
                        <Setter Property="TextBlock.Foreground" Value="Black"/>
                        <Setter Property="TextBlock.FontWeight" Value="Bold"/>
                    </Style>
                </TextBlock.Style>
            </TextBlock>
        </Fluent:RibbonTabItem.Header>

        <Fluent:RibbonGroupBox>

            <StackPanel Orientation="Horizontal">
                <Fluent:Button Margin="5,0,5,0" Header="Add Purchase" />
                <Fluent:Button Margin="5,0,5,0" Header="View / Edit Purchase" />
                <Fluent:Button Margin="5,0,5,0" Header="Price Graph" />
            </StackPanel>

        </Fluent:RibbonGroupBox>

    </Fluent:RibbonTabItem>

    </Fluent:Ribbon>

    <DockPanel x:Name="dockPanel" LastChildFill="True">
        <dock:DockingManager 
                    x:Name="manager" 
            Height="{Binding ElementName=dockPanel, Path=ActualHeight, Converter={StaticResource Conv}}"
                     DataContext="{Binding DockManagerViewModel}"
                     DocumentsSource="{Binding Documents}"
                     AnchorablesSource="{Binding Anchorables}">

            <dock:DockingManager.Resources>

                <DataTemplate DataType="{x:Type vm:SampleDockWindowViewModel}">
                    <v:SampleDockWindowView />
                </DataTemplate>

            </dock:DockingManager.Resources>

            <dock:DockingManager.LayoutItemContainerStyle>

                <Style TargetType="{x:Type dockctrl:LayoutItem}" >
                    <Setter Property="Title" Value="{Binding Model.Title}" />
                    <Setter Property="CloseCommand" Value="{Binding Model.CloseCommand}" />
                    <Setter Property="CanClose" Value="{Binding Model.CanClose}" />
                </Style>
            </dock:DockingManager.LayoutItemContainerStyle>

        </dock:DockingManager>
    </DockPanel>
</DockPanel> 
</Fluent:RibbonWindow>

Viewing all articles
Browse latest Browse all 2690

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>