Mini Kabibi Habibi

Current Path : C:/Users/Public/Documents/DXperience 13.1 Demos/WPF/VB/RibbonDemo.Wpf/Modules/
Upload File :
Current File : C:/Users/Public/Documents/DXperience 13.1 Demos/WPF/VB/RibbonDemo.Wpf/Modules/MVVMRibbon.xaml

<local:RibbonDemoModule x:Class="RibbonDemo.MVVMRibbon"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
             xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
             xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
             xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
             xmlns:dxdb="http://schemas.devexpress.com/winfx/2008/xaml/demobase"
             xmlns:local="clr-namespace:RibbonDemo"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="525">
    <local:RibbonDemoModule.Resources>
        <DataTemplate x:Key="itemTemplate">
            <ContentControl>
                <dxb:BarButtonItem
                    Content="{Binding Caption}"
                    Glyph="{Binding SmallGlyph}"
                    LargeGlyph="{Binding LargeGlyph}"
                    Command="{Binding}"/>
            </ContentControl>
        </DataTemplate>
        <DataTemplate x:Key="subItemTemplate">
            <ContentControl>
                <dxb:BarSubItem Content="{Binding Caption}"
                                    Glyph="{Binding SmallGlyph}"
                                    LargeGlyph="{Binding LargeGlyph}"
                                    GlyphAlignment="Left"
                                    BarItemDisplayMode="ContentAndGlyph"
                                    ItemLinksSource="{Binding Commands}"
                                    ItemTemplate="{StaticResource itemTemplate}"
                                    Command="{Binding}"/>
            </ContentControl>
        </DataTemplate>
        <local:CommandTemplateSelector x:Key="itemTemplateSelector"/>
        <Style x:Key="pageStyle" TargetType="dxr:RibbonPage">
        </Style>
        <DataTemplate x:Key="groupTemplate">
            <ContentControl>
                <dxr:RibbonPageGroup
                    ItemLinksSource="{Binding Commands}"
                    Caption="{Binding Name}"
                    ItemTemplateSelector="{StaticResource itemTemplateSelector}"
                    Glyph="{Binding Glyph}"
                    ShowCaptionButton="True"
                    AllowCollapse="True"
                    CaptionButtonCommand="{Binding}"/>
            </ContentControl>
        </DataTemplate>
        <DataTemplate x:Key="pageTemplate">
            <ContentControl>
                <dxr:RibbonPage
                    GroupsSource="{Binding Groups}"
                    Caption="{Binding Name}"
                    GroupTemplate="{StaticResource groupTemplate}"
                    Style="{StaticResource pageStyle}"/>
            </ContentControl>
        </DataTemplate>
        <DataTemplate x:Key="categoryTemplate">
            <ContentControl>
                <dxr:RibbonDefaultPageCategory
                     PagesSource="{Binding Pages}"
                     PageTemplate="{StaticResource pageTemplate}"
                    />
            </ContentControl>
        </DataTemplate>
    </local:RibbonDemoModule.Resources>
    <dxdb:DemoModuleControl>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <dxb:BarManager>
                <dxr:RibbonControl x:Name="ribbonControl" RibbonStyle="Office2010" RibbonTitleBarVisibility="Collapsed" ToolbarShowMode="Hide" CategoriesSource="{Binding Categories}"  CategoryTemplate="{StaticResource categoryTemplate}">
                    <dxr:RibbonControl.ApplicationMenu>
                        <dxr:ApplicationMenu ItemLinksSource="{Binding MenuItems}" ItemTemplate="{StaticResource itemTemplate}"/>
                    </dxr:RibbonControl.ApplicationMenu>
                </dxr:RibbonControl>
            </dxb:BarManager>
            <TextBox Grid.Row="1" x:Name="textBox" AcceptsReturn="True" TextWrapping="Wrap"></TextBox>
        </Grid>
    </dxdb:DemoModuleControl>
</local:RibbonDemoModule>