<Fluent:RibbonWindow x:Class="AIStudio.Wpf.DiagramApp.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:AIStudio.Wpf.DiagramApp"
        xmlns:Fluent="urn:fluent-ribbon"
        xmlns:utilhandy="https://astudio.github.io/utilcontrol.handy"
        xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramHelper.Controls;assembly=AIStudio.Wpf.DiagramHelper"
        xmlns:views="clr-namespace:AIStudio.Wpf.DiagramApp.Views"
        xmlns:binding="clr-namespace:AIStudio.Wpf.DiagramHelper.Commands;assembly=AIStudio.Wpf.DiagramHelper"
        xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
        xmlns:controlzEx="urn:controlzex"
        xmlns:dragablz="http://dragablz.net/winfx/xaml/dragablz"
        xmlns:helper="clr-namespace:AIStudio.Wpf.DiagramHelper.Helpers;assembly=AIStudio.Wpf.DiagramHelper"
        xmlns:model="clr-namespace:AIStudio.Wpf.DiagramApp.Models"
        xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram" 
        xmlns:drop="urn:gong-wpf-dragdrop"             
        xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
        xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramHelper.Converters;assembly=AIStudio.Wpf.DiagramHelper"
        xmlns:viewmodel="clr-namespace:AIStudio.Wpf.DiagramApp.ViewModels"
        Style="{StaticResource RibbonWindowStyle}"
        Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Icons/App.ico"
        mc:Ignorable="d"
        Title="AIStudio画板" Height="450" Width="800">
    <Fluent:RibbonWindow.Resources>
        <ResourceDictionary>
            <dd:EnumDescriptionConverter x:Key="EnumDescriptionConverter"/>
            <dd:ColorBrushConverter x:Key="ColorBrushConverter"/>
            <dd:ArrowPathConverter x:Key="ArrowPathConverter"/>
            <dd:ArrowSizeConverter x:Key="ArrowSizeConverter"/>
            <dd:LineDashConverter x:Key="LineDashConverter"/>
            <dd:DoubleToThickness x:Key="DoubleToThickness"/>

            <converter:NumberConverter x:Key="NumberConverter"/>
            <converter:Boolean2VisibilityReConverter x:Key="Boolean2VisibilityReConverter"/>
            <converter:NullableToVisibilityConverter x:Key="NullableToVisibilityConverter"/>
            <converter:NullableToBooleanConverter x:Key="NullableToBooleanConverter"/>
            <converter:CountShiftConverter x:Key="CountShiftConverter"/>
            <converter:RulerUnitConverter x:Key="RulerUnitConverter"/>
        </ResourceDictionary>
    </Fluent:RibbonWindow.Resources>
    <Fluent:RibbonWindow.WindowCommands>
        <Fluent:WindowCommands>
            <Fluent:ComboBox Header="Theme" Size="Small" Background="Transparent" BorderBrush="Transparent" BorderThickness="0" Template="{StaticResource ComboboxControlTemplate1}"
                                                     MinWidth="150"
                                                     IsEditable="False"                                                    
                                                     ItemsSource="{Binding Source={x:Static controlzEx:ThemeManager.Current}, Path=Themes}"
                                                     SelectedItem="{Binding CurrentTheme, Mode=TwoWay}">
                <Fluent:ComboBox.ItemTemplate>
                    <DataTemplate DataType="{x:Type controlzEx:Theme}">
                        <StackPanel Orientation="Horizontal">
                            <Ellipse Width="16"
                                                             Height="16"
                                                             Fill="{Binding ShowcaseBrush, Mode=OneWay}" />
                            <TextBlock Text="{Binding DisplayName}" />
                        </StackPanel>
                    </DataTemplate>
                </Fluent:ComboBox.ItemTemplate>
            </Fluent:ComboBox>
        </Fluent:WindowCommands>
    </Fluent:RibbonWindow.WindowCommands>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Fluent:Ribbon x:Name="ribbon" 
                       AutomaticStateManagement="True">
            <Fluent:Ribbon.Menu>
                <Grid>
                    <!--Backstage items can be keytipped-->
                    <Fluent:Backstage x:Name="Backstage" IsOpen="{Binding IsOpenBackstage,Mode=TwoWay}">
                        <Fluent:BackstageTabControl>
                            <Fluent:Button Header="打开"
                                           Icon="{iconPacks:Material Kind=OpenInNew}"
                                           Command="{Binding OpenCommand}"/>
                            <Fluent:BackstageTabItem Header="新建"
                                           Icon="{iconPacks:Material Kind=NewBox}">
                                <TabControl Margin="20,5,20,5"
                                            Style="{DynamicResource InnerBackstageTabControlStyle}">
                                    <TabItem Header="基本绘图" >
                                        <WrapPanel Margin="5">
                                            <Button Margin="5" ToolTip="新建" Command="{Binding NewCommand}" CommandParameter="Normal" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
                                                <Path Stretch="Fill" Margin="25" Fill="{DynamicResource GrayBrush2}" Data="M938.666667 426.666667h-341.333334V85.333333c0-46.933333-38.4-85.333333-85.333333-85.333333s-85.333333 38.4-85.333333 85.333333v341.333334H85.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333s38.4 85.333333 85.333333 85.333333h341.333334v341.333334c0 46.933333 38.4 85.333333 85.333333 85.333333s85.333333-38.4 85.333333-85.333333v-341.333334h341.333334c46.933333 0 85.333333-38.4 85.333333-85.333333s-38.4-85.333333-85.333333-85.333333z" ></Path>
                                            </Button>
                                            <Button Margin="5" ToolTip="流程图"  Command="{Binding NewCommand}" CommandParameter="FlowChart" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
                                                <Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M300 125C203.35 125 125 203.35 125 300S203.35 475 300 475C379.25 475 446.2 422.3 467.75 350H750V450H850V737.9L737.85 850H450V750H150V1050H450V950H737.85L900 1112.2L1112.1499999999999 900L950 737.95V450L1050 450V150H750V250H467.75C446.2500000000001 177.6999999999999 379.2500000000001 125 300 125zM300 375C258.6 375 225 341.4 225 300S258.6 225 300 225S375 258.6 375 300S341.4000000000001 375 300 375zM950 350H850V250H950V350zM900 970.7L829.3 900L900 829.3L970.7 900L900 970.7zM350 950H250V850H350V950z" ></Path>
                                            </Button>
                                            <Button Margin="5" ToolTip="逻辑图"  Command="{Binding NewCommand}" CommandParameter="Logical" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
                                                <Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M 23.6584,49.0333L 23.5634,46.9483L 22.5134,47.9133C 22.1467,48.2067 21.7434,48.4608 21.3034,48.6758C 20.8634,48.8908 20.3851,49.0575 19.8684,49.1758C 19.3517,49.2942 18.7851,49.3533 18.1684,49.3533C 17.3517,49.3533 16.6351,49.2317 16.0184,48.9883C 15.4017,48.745 14.8842,48.4067 14.4659,47.9733C 14.0476,47.54 13.7309,47.0167 13.5159,46.4033C 13.3009,45.79 13.1934,45.115 13.1934,44.3783C 13.1934,43.615 13.3526,42.9108 13.6709,42.2658C 13.9892,41.6208 14.4759,41.0667 15.1309,40.6033C 15.7859,40.14 16.6026,39.7758 17.5809,39.5108C 18.5592,39.2458 19.7067,39.1133 21.0234,39.1133L 23.1134,39.1133L 23.1134,38.1833C 23.1134,37.7867 23.0559,37.4283 22.9409,37.1083C 22.8259,36.7883 22.6409,36.5167 22.3859,36.2933C 22.1309,36.07 21.8001,35.8975 21.3934,35.7758C 20.9867,35.6542 20.4867,35.5933 19.8934,35.5933C 18.9567,35.5933 18.0326,35.7058 17.1209,35.9308C 16.2092,36.1558 15.3267,36.47 14.4734,36.8733L 14.4734,33.6733C 15.2367,33.3967 16.1167,33.1675 17.1134,32.9858C 18.1101,32.8042 19.1451,32.7133 20.2184,32.7133C 21.3984,32.7133 22.4117,32.8258 23.2584,33.0508C 24.1051,33.2758 24.8017,33.6142 25.3484,34.0658C 25.8951,34.5175 26.2992,35.0808 26.5609,35.7558C 26.8226,36.4308 26.9534,37.22 26.9534,38.1233L 26.9534,49.0333L 23.6584,49.0333 Z M 23.1134,41.9934L 20.8284,41.9934C 20.1984,41.9934 19.6634,42.0575 19.2234,42.1859C 18.7834,42.3142 18.4259,42.4909 18.1509,42.7159C 17.8759,42.9409 17.6742,43.2009 17.5459,43.4959C 17.4176,43.7909 17.3534,44.1033 17.3534,44.4333C 17.3534,45.0967 17.5576,45.6025 17.9659,45.9509C 18.3742,46.2992 18.9317,46.4734 19.6384,46.4734C 20.1584,46.4734 20.6992,46.275 21.2609,45.8783C 21.8226,45.4817 22.4401,44.915 23.1134,44.1784L 23.1134,41.9934 Z M 40.0334,49.0333L 40.0334,38.5584C 40.0334,36.795 39.3751,35.9134 38.0584,35.9134C 37.4017,35.9134 36.7734,36.1775 36.1734,36.7059C 35.5734,37.2342 34.9401,37.9517 34.2734,38.8583L 34.2734,49.0333L 30.4334,49.0334L 30.4334,33.0334L 33.7584,33.0334L 33.8534,35.3934L 34.8734,34.2859C 35.2267,33.9542 35.6092,33.6717 36.0209,33.4384C 36.4326,33.205 36.8759,33.0259 37.3509,32.9009C 37.8259,32.7759 38.3584,32.7134 38.9484,32.7134C 39.7717,32.7134 40.4901,32.8467 41.1034,33.1134C 41.7167,33.38 42.2292,33.7575 42.6409,34.2459C 43.0526,34.7342 43.3609,35.3217 43.5659,36.0084C 43.7709,36.695 43.8734,37.4617 43.8734,38.3084L 43.8734,49.0333L 40.0334,49.0333 Z M 57.6534,49.0333L 57.5584,46.6883L 56.5159,47.7808C 56.1576,48.1092 55.7734,48.3892 55.3634,48.6208C 54.9534,48.8525 54.5142,49.0325 54.0459,49.1609C 53.5776,49.2892 53.0601,49.3533 52.4934,49.3533C 51.5467,49.3533 50.7051,49.1642 49.9684,48.7859C 49.2317,48.4075 48.6134,47.87 48.1134,47.1733C 47.6134,46.4767 47.2317,45.6292 46.9684,44.6309C 46.7051,43.6325 46.5734,42.52 46.5734,41.2933C 46.5734,39.8233 46.7809,38.5508 47.1959,37.4758C 47.6109,36.4008 48.1867,35.5092 48.9234,34.8008C 49.6601,34.0925 50.5342,33.5675 51.5459,33.2259C 52.5576,32.8842 53.6567,32.7134 54.8434,32.7134L 56.0509,32.7909L 57.1334,32.9934L 57.1334,26.9534L 60.9734,26.9534L 60.9734,49.0333L 57.6534,49.0333 Z M 50.7334,41.0983C 50.7334,42.0017 50.7926,42.7725 50.9109,43.4108C 51.0292,44.0492 51.2051,44.5717 51.4384,44.9783C 51.6717,45.385 51.9584,45.6825 52.2984,45.8708C 52.6384,46.0592 53.0251,46.1534 53.4584,46.1534C 54.1017,46.1534 54.7126,45.885 55.2909,45.3484C 55.8692,44.8117 56.4834,44.0767 57.1334,43.1433L 57.1334,35.9933L 56.0259,35.7059L 54.6984,35.5933C 54.0917,35.5933 53.5451,35.7225 53.0584,35.9809C 52.5717,36.2392 52.1559,36.6042 51.8109,37.0758C 51.4659,37.5475 51.2001,38.1242 51.0134,38.8059C 50.8267,39.4875 50.7334,40.2517 50.7334,41.0983 Z M 36,60L 36,63L 33,63L 33,67L 36,67L 36,70L 40,70L 40,67L 43,67L 43,63L 40,63L 40,60L 36,60 Z M 38,73C 25.6744,73 14.8369,66.6288 8.60116,57L 67.3988,57C 61.1631,66.6288 50.3256,73 38,73 Z " ></Path>
                                            </Button>
                                            <Button Margin="5" ToolTip="顺序控制图"  Command="{Binding NewCommand}" CommandParameter="SFC" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
                                                <Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M10.984 13.836a.5.5 0 0 1-.353-.146l-.745-.743a.5.5 0 1 1 .706-.708l.392.391 1.181-1.18a.5.5 0 0 1 .708.707l-1.535 1.533a.504.504 0 0 1-.354.146zm9.353-.147l1.534-1.532a.5.5 0 0 0-.707-.707l-1.181 1.18-.392-.391a.5.5 0 1 0-.706.708l.746.743a.497.497 0 0 0 .706-.001zM4.527 7.452l2.557-1.585A1 1 0 0 0 7.09 4.17L4.533 2.56A1 1 0 0 0 3 3.406v3.196a1.001 1.001 0 0 0 1.527.85zm2.03-2.436L4 6.602V3.406l2.557 1.61zM24 12.5c0 1.93-1.57 3.5-3.5 3.5a3.503 3.503 0 0 1-3.46-3h-2.08a3.503 3.503 0 0 1-3.46 3 3.502 3.502 0 0 1-3.46-3h-.558c-.972 0-1.85-.399-2.482-1.042V17c0 1.654 1.346 3 3 3h.04c.244-1.693 1.7-3 3.46-3 1.93 0 3.5 1.57 3.5 3.5S13.43 24 11.5 24a3.502 3.502 0 0 1-3.46-3H8c-2.206 0-4-1.794-4-4V9.899A5.008 5.008 0 0 1 0 5c0-2.757 2.243-5 5-5s5 2.243 5 5a5.005 5.005 0 0 1-4.952 4.998A2.482 2.482 0 0 0 7.482 12h.558c.244-1.693 1.7-3 3.46-3a3.502 3.502 0 0 1 3.46 3h2.08a3.503 3.503 0 0 1 3.46-3c1.93 0 3.5 1.57 3.5 3.5zm-15 8c0 1.378 1.122 2.5 2.5 2.5s2.5-1.122 2.5-2.5-1.122-2.5-2.5-2.5S9 19.122 9 20.5zM5 9c2.206 0 4-1.794 4-4S7.206 1 5 1 1 2.794 1 5s1.794 4 4 4zm9 3.5c0-1.378-1.122-2.5-2.5-2.5S9 11.122 9 12.5s1.122 2.5 2.5 2.5 2.5-1.122 2.5-2.5zm9 0c0-1.378-1.122-2.5-2.5-2.5S18 11.122 18 12.5s1.122 2.5 2.5 2.5 2.5-1.122 2.5-2.5zm-13 8a.5.5 0 1 0 1 0 .5.5 0 0 0-1 0zm2 0a.5.5 0 1 0 1 0 .5.5 0 0 0-1 0zm12 0c0 1.93-1.57 3.5-3.5 3.5a3.503 3.503 0 0 1-3.46-3.002c-.007.001-.013.005-.021.005l-.506.017h-.017a.5.5 0 0 1-.016-.999l.506-.017c.018-.002.035.006.052.007A3.503 3.503 0 0 1 20.5 17c1.93 0 3.5 1.57 3.5 3.5zm-1 0c0-1.378-1.122-2.5-2.5-2.5S18 19.122 18 20.5s1.122 2.5 2.5 2.5 2.5-1.122 2.5-2.5z" ></Path>
                                            </Button>
                                        </WrapPanel>
                                    </TabItem>
                                    <TabItem Header="待续" />
                                </TabControl>
                            </Fluent:BackstageTabItem>
                            <Fluent:Button Header="保存"
                                           Icon="{iconPacks:Material Kind=ContentSave}"
                                           Command="{Binding SaveCommand}" />
                            <Fluent:Button Header="另存为"
                                           Icon="{iconPacks:Material Kind=ContentSaveAll}"
                                           CanAddToQuickAccessToolBar="False"
                                           Command="{Binding SaveAsCommand}" />
                            <Fluent:BackstageTabItem Header="介绍"
                                                     Icon="{DynamicResource Fluent.Ribbon.Images.DefaultPlaceholder}">
                                <views:AboutControl/>
                            </Fluent:BackstageTabItem>

                            <Fluent:BackstageTabItem Header="最近"
                                                     Icon="{iconPacks:Material Kind=History}">
                                <ListBox x:Name="listHistory" ItemsSource="{Binding HistoryList}">
                                    <ListBox.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding .}" ToolTip="{Binding .}"/>
                                        </DataTemplate>
                                    </ListBox.ItemTemplate>
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="MouseDoubleClick">
                                            <i:InvokeCommandAction Command="{Binding OpenCommand}" CommandParameter="{Binding SelectedItem, ElementName=listHistory}"/>
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </ListBox>
                            </Fluent:BackstageTabItem>

                            <Fluent:Button x:Name="btnExit"
                                           Header="Exit"
                                           Icon="{iconPacks:Material Kind=ExitToApp}"
                                           Click="btnExit_Click" />
                        </Fluent:BackstageTabControl>
                    </Fluent:Backstage>

                    <!--<Fluent:ApplicationMenu x:Name="ApplicationMenu" Header="文件"
                                            Visibility="Visible">
                        <Fluent:ApplicationMenu.RightPaneContent>
                            <StackPanel HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"
                                        Orientation="Vertical">

                                <Border HorizontalAlignment="Stretch"
                                        BorderBrush="#64647F"
                                        BorderThickness="0,0,0,0">

                                    <TextBlock Text="Recent files"
                                               Background="#F6F7F8"
                                               TextAlignment="Left"
                                               Padding="12,4,4,4"
                                               Foreground="#64647F"
                                               FontWeight="SemiBold"
                                               FontSize="12" />
                                </Border>

                                <StackPanel HorizontalAlignment="Stretch"
                                            Height="2">

                                    <Border Height="1"
                                            BorderThickness="1"
                                            HorizontalAlignment="Stretch"
                                            BorderBrush="#DCDDDE" />

                                    <Border Height="1"
                                            BorderThickness="1"
                                            HorizontalAlignment="Stretch"
                                            BorderBrush="#FEFEFF" />

                                </StackPanel>

                                <ItemsControl ItemsSource="{Binding GalleryViewModel.Items}">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <Fluent:MenuItem Header="{Binding Text}"
                                                             ToolTip="{Binding Text}"
                                                             Description="{Binding Group}"
                                                             IsDefinitive="True"
                                                             Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/BlueLarge.png" />
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                            </StackPanel>
                        </Fluent:ApplicationMenu.RightPaneContent>

                        <Fluent:MenuItem Header="New" Command="{Binding NewCommand}" Size="Small"
                                         Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/GenericDocument.png"/>

                        <Fluent:MenuItem Header="Save" Command="{Binding SaveCommand}" Size="Small"
                                         Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/Save.png"/>

                        <Fluent:MenuItem Header="Save As" Command="{Binding SaveAsCommand}" Size="Small"
                                         Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/saveas.png">
                        </Fluent:MenuItem>

                        <Fluent:MenuItem Header="Open" Command="{Binding OpenCommand}" Size="Small"
                                         Description="CTRL + O"
                                         ToolTip="Open object"
                                         Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/OpenFolder.png" />

                        <Separator />

                        <Fluent:MenuItem Header="Exit" Size="Small"
                                         Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/exit.png"
                                         Command="{Binding ExitCommand}" />
                    </Fluent:ApplicationMenu>-->
                </Grid>
            </Fluent:Ribbon.Menu>

            <Fluent:Ribbon.ToolBarItems>
                <Fluent:Button Size="Small"
                               Icon="{DynamicResource Fluent.Ribbon.Images.Help}">
                    <Fluent:Button.ToolTip>
                        <Fluent:ScreenTip Title="Help"
                                          Text="帮助文档"
                                          Image="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/help.jpg"
                                          HelpTopic="https://github.com/fluentribbon/Fluent.Ribbon"
                                          Width="190"
                                          IsRibbonAligned="True" />
                    </Fluent:Button.ToolTip>
                </Fluent:Button>
            </Fluent:Ribbon.ToolBarItems>

            <Fluent:Ribbon.QuickAccessItems>
                <!--Quick Access toolbar items automatically have ScreenTips of the target -->
                <!--KeyTips in Quick Access Toolbar names automatically-->

                <!--Use Content or Target Property to set QAT item-->
                <Fluent:QuickAccessMenuItem IsChecked="true">
                    <Fluent:Button Header="保存"
                                   Command="{Binding SaveCommand}"
                                   Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/Save.png" />
                </Fluent:QuickAccessMenuItem>
                <!-- todo: netcore => was using x:Reference before -->
                <Fluent:QuickAccessMenuItem Target="{Binding ElementName=pasteButton}"
                                            IsChecked="True" />
                <!-- todo: netcore => was using x:Reference before -->
                <Fluent:QuickAccessMenuItem Target="{Binding ElementName=cutButton}"
                                            IsChecked="True" />
                <!-- todo: netcore => was using x:Reference before -->
                <Fluent:QuickAccessMenuItem Target="{Binding ElementName=copyButton}"
                                            IsChecked="True"/>
                <!-- todo: netcore => was using x:Reference before -->
                <Fluent:QuickAccessMenuItem Target="{Binding ElementName=undoButton}"
                                            IsChecked="True" />
                <Fluent:QuickAccessMenuItem Target="{Binding ElementName=redoButton}" 
                                            IsChecked="True" />
            </Fluent:Ribbon.QuickAccessItems>

            <Fluent:RibbonTabItem Header="开始">
                <Fluent:RibbonGroupBox Header="剪贴板"
                                       IsLauncherVisible="True"     
                                       Icon="{DynamicResource Fluent.Ribbon.Images.DefaultPlaceholder}"                 
                                       x:Name="Clipboard">
                    <Fluent:Button x:Name="pasteButton"
                                   Header="粘贴"
                                   Icon="{DynamicResource Fluent.Ribbon.Images.Paste}"
                                   SizeDefinition="Middle,Small"
                                   Command="{Binding PasteCommand}"
                                   FocusManager.IsFocusScope="True">
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="Paste (Ctrl+V)"
                                              Text="从剪贴板进行粘贴"
                                              DisableReason="需要先进行复制"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                    <Fluent:Button x:Name="cutButton"
                                   Header="剪贴"
                                   Icon="{DynamicResource Fluent.Ribbon.Images.Cut}"
                                   SizeDefinition="Middle,Small"
                                   Command="{Binding CutCommand}"
                                   FocusManager.IsFocusScope="True">
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="Cut (Ctrl+X)"
                                              Text="把对象剪贴到剪贴板"
                                              DisableReason="需要选中剪贴对象"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                    <Fluent:Button x:Name="copyButton"
                                   Header="复制"
                                   Icon="{DynamicResource Fluent.Ribbon.Images.Copy}"
                                   Command="{Binding CopyCommand}"
                                   FocusManager.IsFocusScope="True">
                        <Fluent:Button.SizeDefinition>
                            <Fluent:RibbonControlSizeDefinition Large="Middle"
                                                                Middle="Small" />
                        </Fluent:Button.SizeDefinition>
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="Copy (Ctrl+C)"
                                              Text="把对象复制到剪贴板"
                                              DisableReason="需要选中复制对象"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                    <Fluent:Button Header="格式化"
                                   Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/FormatPainter.png"
                                   SizeDefinition="Middle,Small" 
                                   Command="{Binding FormatCommand}">
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="Format"
                                              Text="把选中对象的格式复制到格式化的对象"
                                              DisableReason="需要选中格式源对象"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                    <Fluent:Button x:Name="undoButton"
                                   Header="撤销"
                                   Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/undo.png"
                                   SizeDefinition="Middle,Small" 
                                   Command="{Binding DiagramsViewModel.DiagramViewModel.UndoCommand}">
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="Undo"
                                              Text="撤销操作"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                    <Fluent:Button x:Name="redoButton"
                                   Header="重做"
                                   Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/redo.png"
                                   SizeDefinition="Middle,Small" 
                                   Command="{Binding DiagramsViewModel.DiagramViewModel.RedoCommand}">
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="Redo"
                                              Text="重做操作"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="字体"
                                       IsLauncherVisible="True"   
                                       DataContext="{Binding FontViewModel}"
                                       x:Name="Font"
                                       Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/FontColor.png">
                    <Fluent:RibbonToolBar>
                        <!--ToolBar Layout Definitions-->
                        <Fluent:RibbonToolBar.LayoutDefinitions>
                            <Fluent:RibbonToolBarLayoutDefinition Size="Large">
                                <Fluent:RibbonToolBarRow>
                                    <Fluent:RibbonToolBarControlDefinition Target="comboBoxFontName"
                                                                           Width="75" />
                                    <Fluent:RibbonToolBarControlDefinition Target="comboBoxFontSize"
                                                                           Width="45" />
                                    <Fluent:RibbonToolBarControlGroupDefinition>
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonGrowFont" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonShrinkFont" />
                                    </Fluent:RibbonToolBarControlGroupDefinition>
                                    <Fluent:RibbonToolBarControlGroupDefinition>
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonChangeCase" />
                                    </Fluent:RibbonToolBarControlGroupDefinition>
                                    <Fluent:RibbonToolBarControlGroupDefinition>
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonClearFormatting" />
                                    </Fluent:RibbonToolBarControlGroupDefinition>
                                    <Fluent:RibbonToolBarControlGroupDefinition>
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonAlign" />
                                    </Fluent:RibbonToolBarControlGroupDefinition>
                                </Fluent:RibbonToolBarRow>
                                <Fluent:RibbonToolBarRow>
                                    <Fluent:RibbonToolBarControlGroupDefinition>
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonBold" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonItalic" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonUnderline" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonStrikethrough" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonSubscript" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonSuperscript" />
                                    </Fluent:RibbonToolBarControlGroupDefinition>
                                    <Fluent:RibbonToolBarControlGroupDefinition>
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonLineHeight" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonTextEffects" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonTextHighlightColor" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonFontColor" />
                                    </Fluent:RibbonToolBarControlGroupDefinition>
                                </Fluent:RibbonToolBarRow>
                            </Fluent:RibbonToolBarLayoutDefinition>

                            <Fluent:RibbonToolBarLayoutDefinition Size="Middle">
                                <Fluent:RibbonToolBarRow>
                                    <Fluent:RibbonToolBarControlDefinition Target="comboBoxFontName"
                                                                           Width="125" />
                                    <Fluent:RibbonToolBarControlDefinition Target="comboBoxFontSize"
                                                                           Width="50" />
                                </Fluent:RibbonToolBarRow>
                                <Fluent:RibbonToolBarRow>
                                    <Fluent:RibbonToolBarControlGroupDefinition>
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonBold" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonItalic" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonUnderline" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonStrikethrough" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonSubscript" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonSuperscript" />
                                    </Fluent:RibbonToolBarControlGroupDefinition>
                                    <Fluent:RibbonToolBarControlGroupDefinition>
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonClearFormatting" />
                                    </Fluent:RibbonToolBarControlGroupDefinition>
                                    <Fluent:RibbonToolBarControlGroupDefinition>
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonAlign" />
                                    </Fluent:RibbonToolBarControlGroupDefinition>
                                </Fluent:RibbonToolBarRow>
                                <Fluent:RibbonToolBarRow>
                                    <Fluent:RibbonToolBarControlGroupDefinition>
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonLineHeight" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonTextEffects" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonTextHighlightColor" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonFontColor" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonChangeCase" />
                                    </Fluent:RibbonToolBarControlGroupDefinition>
                                    <Fluent:RibbonToolBarControlGroupDefinition>
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonGrowFont" />
                                        <Fluent:RibbonToolBarControlDefinition Target="buttonShrinkFont" />
                                    </Fluent:RibbonToolBarControlGroupDefinition>
                                </Fluent:RibbonToolBarRow>
                            </Fluent:RibbonToolBarLayoutDefinition>
                        </Fluent:RibbonToolBar.LayoutDefinitions>

                        <!--ToolBar Controls-->
                        <Fluent:ComboBox x:Name="comboBoxFontName"
                                         MinWidth="40"
                                         Height="22"
                                         BorderBrush="Gainsboro"
                                         IsTextSearchEnabled="True"
                                         ResizeMode="Vertical"
                                         SizeDefinition="Small"
                                         ScrollViewer.CanContentScroll="False"
                                         ItemsSource="{Binding FontFamilys}"
                                         SelectedItem="{Binding FontFamily}">
                            <Fluent:ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding}"
                                           FontFamily="{Binding}" />
                                </DataTemplate>
                            </Fluent:ComboBox.ItemTemplate>
                            <Fluent:ComboBox.ToolTip>
                                <Fluent:ScreenTip Title="FontFamily"
                                              Text="字体"
                                              Width="190" />
                            </Fluent:ComboBox.ToolTip>
                        </Fluent:ComboBox>
                        <Fluent:ComboBox x:Name="comboBoxFontSize"
                                         Width="49"
                                         HorizontalAlignment="Left"
                                         Height="22"
                                         BorderBrush="Gainsboro"
                                         IsEditable="True"
                                         SizeDefinition="Small"
                                         ResizeMode="Vertical"
                                         ItemsSource="{Binding FontSizes}"
                                         Text="{Binding FontSize}">
                            <Fluent:ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding}"/>
                                </DataTemplate>
                            </Fluent:ComboBox.ItemTemplate>
                            <Fluent:ComboBox.ToolTip>
                                <Fluent:ScreenTip Title="FontSize"
                                              Text="字体大小"
                                              Width="190" />
                            </Fluent:ComboBox.ToolTip>
                        </Fluent:ComboBox>
                        <Fluent:Button x:Name="buttonGrowFont"
                                       Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/GrowFont.png"
                                       HorizontalAlignment="Left"
                                       SizeDefinition="Small" 
                                       Command="{Binding GrowFontCommand}">
                            <Fluent:Button.ToolTip>
                                <Fluent:ScreenTip Title="GrowFont"
                                              Text="加大字体大小"
                                              Width="190" />
                            </Fluent:Button.ToolTip>
                        </Fluent:Button>
                        <Fluent:Button x:Name="buttonShrinkFont"
                                       Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/ShrinkFont.png"
                                       HorizontalAlignment="Left"
                                       SizeDefinition="Small"
                                       Command="{Binding ShrinkFontCommand}">
                            <Fluent:Button.ToolTip>
                                <Fluent:ScreenTip Title="ShrinkFont"
                                              Text="减小字体大小"
                                              Width="190" />
                            </Fluent:Button.ToolTip>
                        </Fluent:Button>
                        <Fluent:DropDownButton x:Name="buttonChangeCase"
                                               Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/ChangeCase.png"
                                               HorizontalAlignment="Left"
                                               SizeDefinition="Small" >
                            <Fluent:MenuItem Header="正常" Size="Middle" IsCheckable="True" IsChecked="{Binding FontCase,Converter={dd:ConverterValueMapToBool Parameter='None'}, ConverterParameter='None'}"  />
                            <Fluent:MenuItem Header="大写" Size="Middle" IsCheckable="True" IsChecked="{Binding FontCase,Converter={dd:ConverterValueMapToBool Parameter='Upper'}, ConverterParameter='Upper'}" />
                            <Fluent:MenuItem Header="小写" Size="Middle" IsCheckable="True" IsChecked="{Binding FontCase,Converter={dd:ConverterValueMapToBool Parameter='Lower'}, ConverterParameter='Lower'}"  />
                            <Fluent:DropDownButton.ToolTip>
                                <Fluent:ScreenTip Title="ChangeCase"
                                              Text="字体大小写"
                                              Width="190" />
                            </Fluent:DropDownButton.ToolTip>
                        </Fluent:DropDownButton>
                        <Fluent:Button x:Name="buttonClearFormatting"
                                       Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/ClearFormatting.png"
                                       HorizontalAlignment="Left"
                                       SizeDefinition="Small"
                                       Command="{Binding ClearFormattingCommand}">
                            <Fluent:Button.ToolTip>
                                <Fluent:ScreenTip Title="ClearFormatting"
                                              Text="清除格式"
                                              Width="190" />
                            </Fluent:Button.ToolTip>
                        </Fluent:Button>
                        <Fluent:DropDownButton x:Name="buttonAlign"
                                       Icon="{iconPacks:Material Kind=FormatAlignLeft}"
                                       HorizontalAlignment="Left"
                                       SizeDefinition="Small">
                            <UniformGrid Rows="3" Columns="4">
                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='TopAlignLeft'}, ConverterParameter='TopAlignLeft'}" ToolTip="左上对齐">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignLeft" VerticalAlignment="Top" HorizontalAlignment="Left"/>
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>
                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='TopAlignCenter'}, ConverterParameter='TopAlignCenter'}" ToolTip="顶部中间对齐">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignCenter" VerticalAlignment="Top" HorizontalAlignment="Center"/>
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>
                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='TopAlignRight'}, ConverterParameter='TopAlignRight'}" ToolTip="右上对齐">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignRight" VerticalAlignment="Top" HorizontalAlignment="Right" />
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>
                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='TopAlignJustify'}, ConverterParameter='TopAlignJustify'}" ToolTip="顶部两端对齐">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <Viewbox VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="16" Stretch="Fill">
                                                <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignJustify"  />
                                            </Viewbox>
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>

                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='CenterAlignLeft'}, ConverterParameter='CenterAlignLeft'}" ToolTip="中间左对齐">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignLeft" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>
                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='CenterAlignCenter'}, ConverterParameter='CenterAlignCenter'}" ToolTip="居中">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignCenter" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>
                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='CenterAlignRight'}, ConverterParameter='CenterAlignRight'}" ToolTip="中间右对齐">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignRight" VerticalAlignment="Center" HorizontalAlignment="Right"/>
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>
                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='CenterAlignJustify'}, ConverterParameter='CenterAlignJustify'}" ToolTip="中间两端对齐">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <Viewbox VerticalAlignment="Center" HorizontalAlignment="Stretch" Height="16" Stretch="Fill">
                                                <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignJustify"  />
                                            </Viewbox>
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>

                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='BottomAlignLeft'}, ConverterParameter='BottomAlignLeft'}" ToolTip="底部左对齐">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignLeft" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>
                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='BottomAlignCenter'}, ConverterParameter='BottomAlignCenter'}" ToolTip="底部中间对齐">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignCenter" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>
                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='BottomAlignRight'}, ConverterParameter='BottomAlignRight'}" ToolTip="底部右对齐">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignRight" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>
                                <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large"  IsChecked="{Binding HorizontalVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='BottomAlignJustify'}, ConverterParameter='BottomAlignJustify'}" ToolTip="底部两端对齐">
                                    <Fluent:ToggleButton.LargeIcon>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="0,6,0,0">
                                            <Viewbox VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Height="16" Stretch="Fill">
                                                <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignJustify"  />
                                            </Viewbox>
                                        </Border>
                                    </Fluent:ToggleButton.LargeIcon>
                                </Fluent:ToggleButton>
                            </UniformGrid>
                            <Fluent:DropDownButton.ToolTip>
                                <Fluent:ScreenTip Title="Align"
                                              Text="文字对齐方向"
                                              Width="190" />
                            </Fluent:DropDownButton.ToolTip>
                        </Fluent:DropDownButton>
                        <Fluent:ToggleButton x:Name="buttonBold"
                                             Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/Bold.png"
                                             HorizontalAlignment="Left"
                                             SizeDefinition="Small" 
                                             IsChecked="{Binding FontWeight,Converter={dd:ConverterValueMapToBool Parameter='Regular'}, ConverterParameter='Bold'}">
                            <Fluent:ToggleButton.ToolTip>
                                <Fluent:ScreenTip Title="Bold"
                                              Text="加粗"
                                              Width="190" />
                            </Fluent:ToggleButton.ToolTip>
                        </Fluent:ToggleButton>
                        <Fluent:ToggleButton x:Name="buttonItalic"
                                             Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/Italic.png"
                                             HorizontalAlignment="Left"
                                             SizeDefinition="Small" 
                                             IsChecked="{Binding FontStyle,Converter={dd:ConverterValueMapToBool Parameter='Normal'}, ConverterParameter='Italic'}">
                            <Fluent:ToggleButton.ToolTip>
                                <Fluent:ScreenTip Title="Italic"
                                              Text="斜体"
                                              Width="190" />
                            </Fluent:ToggleButton.ToolTip>
                        </Fluent:ToggleButton>
                        <Fluent:ToggleButton x:Name="buttonUnderline"
                                             Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/Underline.png"
                                             HorizontalAlignment="Left"
                                             SizeDefinition="Small" 
                                             IsChecked="{Binding Underline}">
                            <Fluent:ToggleButton.ToolTip>
                                <Fluent:ScreenTip Title="Underline"
                                              Text="下划线"
                                              Width="190" />
                            </Fluent:ToggleButton.ToolTip>
                        </Fluent:ToggleButton>
                        <Fluent:ToggleButton x:Name="buttonStrikethrough" 
                                             Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/Strikethrough.png"
                                             HorizontalAlignment="Left"
                                             SizeDefinition="Small" 
                                             IsChecked="{Binding Strikethrough}">
                            <Fluent:ToggleButton.ToolTip>
                                <Fluent:ScreenTip Title="Strikethrough"
                                              Text="删除线"
                                              Width="190" />
                            </Fluent:ToggleButton.ToolTip>
                        </Fluent:ToggleButton>
                        <Fluent:Button x:Name="buttonSubscript"
                                       Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/Subscript.png"
                                       HorizontalAlignment="Left"
                                       SizeDefinition="Small" >
                            <Fluent:Button.ToolTip>
                                <Fluent:ScreenTip Title="Subscript"
                                              Text="下标（未实现）"
                                              Width="190" />
                            </Fluent:Button.ToolTip>
                        </Fluent:Button>
                        <Fluent:Button x:Name="buttonSuperscript"
                                       Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/Superscript.png"
                                       HorizontalAlignment="Left"
                                       SizeDefinition="Small" >
                            <Fluent:Button.ToolTip>
                                <Fluent:ScreenTip Title="Superscript"
                                              Text="上标（未实现）"
                                              Width="190" />
                            </Fluent:Button.ToolTip>
                        </Fluent:Button>
                        <Fluent:DropDownButton x:Name="buttonLineHeight"
                                               Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/line-height.png"
                                               HorizontalAlignment="Left"
                                               SizeDefinition="Small" >
                            <Fluent:MenuItem Header="1.0" Size="Middle" IsCheckable="True" IsChecked="{Binding LineHeight,Converter={dd:ConverterValueMapToBool Parameter='12'}, ConverterParameter='12'}"  />
                            <Fluent:MenuItem Header="1.2" Size="Middle" IsCheckable="True" IsChecked="{Binding LineHeight,Converter={dd:ConverterValueMapToBool Parameter='15'}, ConverterParameter='15'}" />
                            <Fluent:MenuItem Header="1.5" Size="Middle" IsCheckable="True" IsChecked="{Binding LineHeight,Converter={dd:ConverterValueMapToBool Parameter='18'}, ConverterParameter='18'}"  />
                            <Fluent:MenuItem Header="2.0" Size="Middle" IsCheckable="True" IsChecked="{Binding LineHeight,Converter={dd:ConverterValueMapToBool Parameter='24'}, ConverterParameter='24'}"  />
                            <Fluent:MenuItem Header="2.5" Size="Middle" IsCheckable="True" IsChecked="{Binding LineHeight,Converter={dd:ConverterValueMapToBool Parameter='30'}, ConverterParameter='30'}"  />
                            <Fluent:MenuItem Header="3.0" Size="Middle" IsCheckable="True" IsChecked="{Binding LineHeight,Converter={dd:ConverterValueMapToBool Parameter='36'}, ConverterParameter='36'}"  />
                            <Fluent:DropDownButton.ToolTip>
                                <Fluent:ScreenTip Title="LineHeight"
                                              Text="行间距"
                                              Width="190" />
                            </Fluent:DropDownButton.ToolTip>
                        </Fluent:DropDownButton>
                        <!-- It's possible to create custom icon to present selected color -->
                        <Fluent:SplitButton x:Name="buttonTextEffects" 
                                            Command="{Binding TextEffectColorCommand}" 
                                            CommandParameter="{Binding TextEffectColor}"
                                            HorizontalAlignment="Left"
                                            SizeDefinition="Small">
                            <Fluent:SplitButton.Icon>
                                <Grid>
                                    <Image Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/TextEffects.png"
                                           Width="16"
                                           Height="16" />
                                    <Rectangle VerticalAlignment="Bottom"
                                               Height="2"
                                               Width="16"
                                               HorizontalAlignment="Center">
                                        <Rectangle.Fill>
                                            <SolidColorBrush Color="{Binding TextEffectColor}" />
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Grid>
                            </Fluent:SplitButton.Icon>
                            <Fluent:ColorGallery Mode="StandardColors"
                                                 SelectedColor="{Binding TextEffectColor, Mode=TwoWay}" />
                            <Fluent:SplitButton.ToolTip>
                                <Fluent:ScreenTip Title="TextEffects"
                                              Text="文字阴影"
                                              Width="190" />
                            </Fluent:SplitButton.ToolTip>
                        </Fluent:SplitButton>

                        <!-- The following code shows highlight colors mode for color gallery -->
                        <Fluent:SplitButton x:Name="buttonTextHighlightColor"
                                            Command="{Binding HighlightColorCommand}" 
                                            CommandParameter="{Binding HighlightColor}"
                                            HorizontalAlignment="Left"
                                            SizeDefinition="Small">
                            <Fluent:SplitButton.Icon>
                                <Grid>
                                    <Image Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/TextHighlightColor.png"
                                           Width="16"
                                           Height="16" />
                                    <Rectangle VerticalAlignment="Bottom"
                                               Height="4"
                                               Width="16"
                                               HorizontalAlignment="Center">
                                        <Rectangle.Fill>
                                            <SolidColorBrush Color="{Binding HighlightColor}" />
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Grid>
                            </Fluent:SplitButton.Icon>
                            <Fluent:ColorGallery Mode="HighlightColors"
                                                 SelectedColor="{Binding HighlightColor, Mode=TwoWay}"
                                                 IsAutomaticColorButtonVisible="False" />
                            <Fluent:SplitButton.ToolTip>
                                <Fluent:ScreenTip Title="HighlightColor"
                                              Text="高亮色（暂未实现）"
                                              Width="190" />
                            </Fluent:SplitButton.ToolTip>
                        </Fluent:SplitButton>

                        <!-- The following code shows theme colors mode for color gallery -->
                        <Fluent:SplitButton x:Name="buttonFontColor"
                                            Command="{Binding FontColorCommand}" 
                                            CommandParameter="{Binding FontColor}"
                                            HorizontalAlignment="Left"
                                            SizeDefinition="Small"
                                            MaxDropDownHeight="500">
                            <Fluent:DropDownButton.Icon>
                                <Grid>
                                    <Image Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/FontColor.png"
                                           Width="16"
                                           Height="16"
                                           SnapsToDevicePixels="True" />
                                    <Rectangle VerticalAlignment="Bottom"
                                               Height="4"
                                               Width="16"
                                               HorizontalAlignment="Center">
                                        <Rectangle.Fill>
                                            <SolidColorBrush Color="{Binding FontColor}" />
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Grid>
                            </Fluent:DropDownButton.Icon>
                            <Fluent:ColorGallery ThemeColorsSource="{Binding FontColors}"
                                                 SelectedColor="{Binding FontColor, Mode=TwoWay}"
                                                 Mode="ThemeColors"
                                                 StandardColorGridRows="3"
                                                 Columns="10"
                                                 ThemeColorGridRows="5"
                                                 IsNoColorButtonVisible="True" />
                            <Fluent:SplitButton.ToolTip>
                                <Fluent:ScreenTip Title="FontColor"
                                              Text="字体颜色"
                                              Width="190" />
                            </Fluent:SplitButton.ToolTip>
                        </Fluent:SplitButton>
                    </Fluent:RibbonToolBar>
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="选择"
                                       IsLauncherVisible="True"   
                                       DataContext="{Binding DrawModeViewModel}">

                    <Fluent:ToggleButton Header="选择" GroupName="DrawMode" IsChecked="{Binding CursorDrawModeSelected}" Icon="{iconPacks:Material Kind=CursorDefaultOutline}" Width="50">
                        <Fluent:ToggleButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="CursorDefaultOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:ToggleButton.LargeIcon>
                        <Fluent:ToggleButton.ToolTip>
                            <Fluent:ScreenTip Title="Cursor"
                                              Text="选择"
                                              Width="190" />
                        </Fluent:ToggleButton.ToolTip>
                    </Fluent:ToggleButton>

                    <Fluent:SplitButton Header="连接线" GroupName="DrawMode" IsCheckable="True" IsChecked="{Binding VectorLineDrawModeSelected}" Icon="{iconPacks:Material Kind=VectorPolyline}" Width="50" VerticalAlignment="Top">
                        <Fluent:MenuItem Header="直线连接线" Size="Middle" IsCheckable="True" IsChecked="{Binding VectorLineDrawMode,Converter={dd:ConverterValueMapToBool Parameter='ConnectingLine'}, ConverterParameter='ConnectingLine'}" Icon="{iconPacks:Material Kind=VectorLine}"/>
                        <Fluent:MenuItem Header="折角连接线" Size="Middle" IsCheckable="True" IsChecked="{Binding VectorLineDrawMode,Converter={dd:ConverterValueMapToBool Parameter='CornerConnectingLine'}, ConverterParameter='CornerConnectingLine'}" Icon="{iconPacks:Material Kind=VectorPolyline}"/>
                        <Fluent:MenuItem Header="边界连接线" Size="Middle" IsCheckable="True" IsChecked="{Binding VectorLineDrawMode,Converter={dd:ConverterValueMapToBool Parameter='BoundaryConnectingLine'}, ConverterParameter='BoundaryConnectingLine'}" Icon="{iconPacks:Material Kind=VectorPolylineEdit}"/>
                        <Fluent:MenuItem Header="曲线连接线" Size="Middle" IsCheckable="True" IsChecked="{Binding VectorLineDrawMode,Converter={dd:ConverterValueMapToBool Parameter='RadiusConnectingLine'}, ConverterParameter='RadiusConnectingLine'}" Icon="{iconPacks:Material Kind=VectorRadius}"/>
                        <Fluent:SplitButton.Style>
                            <Style TargetType="{x:Type Fluent:SplitButton}" BasedOn="{StaticResource RibbonSplitButtonStyle}">
                                <Setter Property="LargeIcon">
                                    <Setter.Value>
                                        <iconPacks:PackIconMaterial Kind="VectorPolyline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding VectorLineDrawMode}" Value="ConnectingLine">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="VectorLine" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding VectorLineDrawMode}" Value="CornerConnectingLine">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="VectorPolyline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding VectorLineDrawMode}" Value="BoundaryConnectingLine">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="VectorPolylineEdit" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding VectorLineDrawMode}" Value="RadiusConnectingLine">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="VectorRadius" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Fluent:SplitButton.Style>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Line"
                                              Text="添加连接线"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>

                    <Fluent:SplitButton Header="形状" GroupName="DrawMode" IsCheckable="True" IsChecked="{Binding ShapeDrawModeSelected}"  Width="50" VerticalAlignment="Top">
                        <Fluent:MenuItem Header="矩形工具" Size="Middle" IsCheckable="True" IsChecked="{Binding ShapeDrawMode,Converter={dd:ConverterValueMapToBool Parameter='Rectangle'}, ConverterParameter='Rectangle'}" Icon="{iconPacks:Material Kind=RectangleOutline}" />
                        <Fluent:MenuItem Header="椭圆工具" Size="Middle" IsCheckable="True" IsChecked="{Binding ShapeDrawMode,Converter={dd:ConverterValueMapToBool Parameter='Ellipse'}, ConverterParameter='Ellipse'}" Icon="{iconPacks:Material Kind=EllipseOutline}" />
                        <Fluent:MenuItem Header="线条工具" Size="Middle" IsCheckable="True" IsChecked="{Binding ShapeDrawMode,Converter={dd:ConverterValueMapToBool Parameter='Line'}, ConverterParameter='Line'}" Icon="{iconPacks:Material Kind=Minus}" />
                        <Fluent:MenuItem Header="铅笔工具" Size="Middle" IsCheckable="True" IsChecked="{Binding ShapeDrawMode,Converter={dd:ConverterValueMapToBool Parameter='Polyline'}, ConverterParameter='Polyline'}" Icon="{iconPacks:Material Kind=Pencil}" />
                        <Fluent:MenuItem Header="钢笔工具" Size="Middle" IsCheckable="True" IsChecked="{Binding ShapeDrawMode,Converter={dd:ConverterValueMapToBool Parameter='DirectLine'}, ConverterParameter='DirectLine'}" Icon="{iconPacks:Material Kind=FountainPenTip}" />
                        <Fluent:SplitButton.Style>
                            <Style TargetType="{x:Type Fluent:SplitButton}" BasedOn="{StaticResource RibbonSplitButtonStyle}">
                                <Setter Property="LargeIcon">
                                    <Setter.Value>
                                        <iconPacks:PackIconMaterial Kind="Minus" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding ShapeDrawMode}" Value="Line">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="Minus" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding ShapeDrawMode}" Value="Rectangle">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="RectangleOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding ShapeDrawMode}" Value="Ellipse">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="EllipseOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding ShapeDrawMode}" Value="Polyline">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="Pencil" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding ShapeDrawMode}" Value="DirectLine">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="FountainPenTip" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Fluent:SplitButton.Style>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Shape"
                                              Text="添加形状"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>

                    <Fluent:ToggleButton Header="文本" GroupName="DrawMode" IsChecked="{Binding TextDrawModeSelected}" Icon="{iconPacks:Material Kind=FormatText}" Width="50">
                        <Fluent:ToggleButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="FormatText" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:ToggleButton.LargeIcon>
                        <Fluent:ToggleButton.ToolTip>
                            <Fluent:ScreenTip Title="Text"
                                              Text="添加文本"
                                              Width="190" />
                        </Fluent:ToggleButton.ToolTip>
                    </Fluent:ToggleButton>

                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="操作" IsEnabled="{Binding SelectedItem,Converter={StaticResource NullableToBooleanConverter}}"
                                       IsLauncherVisible="True">
                    <Fluent:DropDownButton Header="位置" Icon="{iconPacks:Material Kind=LayersOutline}" Width="50" VerticalAlignment="Top">
                        <Fluent:DropDownButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="LayersOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:DropDownButton.LargeIcon>
                        <Fluent:Button Margin="5" Header="置于顶层" Command="{Binding BringToFrontCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/BringToFront.png"/>
                        <Fluent:Button Margin="5" Header="置于底层" Command="{Binding SendToBackCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/SendToBack.png"/>
                        <Fluent:Button Margin="5" Header="上移一层" Command="{Binding BringForwardCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/BringForward.png"/>
                        <Fluent:Button Margin="5" Header="下移一层" Command="{Binding SendBackwardCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/SendBackward.png"/>
                    </Fluent:DropDownButton>
                    <Fluent:DropDownButton Header="组合" Icon="{iconPacks:Material Kind=Group}" Width="50" VerticalAlignment="Top">
                        <Fluent:DropDownButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="Group" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:DropDownButton.LargeIcon>
                        <Fluent:Button Margin="5" Header="组合" Command="{Binding GroupCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/BringForward.png"/>
                        <Fluent:Button Margin="5" Header="取消组合" Command="{Binding UngroupCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/SendBackward.png"/>
                    </Fluent:DropDownButton>
                    <Fluent:DropDownButton Header="对齐" Icon="{iconPacks:Material Kind=AlignHorizontalLeft}" Width="50" VerticalAlignment="Top">
                        <Fluent:DropDownButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="AlignHorizontalLeft" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:DropDownButton.LargeIcon>
                        <TextBlock Margin="5" Text="对齐"/>
                        <StackPanel Orientation="Horizontal">
                            <Fluent:Button Margin="5" Command="{Binding AlignLeftCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/AlignObjectsLeft.png"/>
                            <Fluent:Button Margin="5" Command="{Binding AlignHorizontalCentersCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/AlignObjectsCenteredHorizontal.png"/>
                            <Fluent:Button Margin="5" Command="{Binding AlignRightCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/AlignObjectsRight.png"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Fluent:Button Margin="5" Command="{Binding AlignTopCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/AlignObjectsTop.png"/>
                            <Fluent:Button Margin="5" Command="{Binding AlignVerticalCentersCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/AlignObjectsCenteredVertical.png"/>
                            <Fluent:Button Margin="5" Command="{Binding AlignBottomCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/AlignObjectsBottom.png"/>
                        </StackPanel>
                        <Separator />
                        <TextBlock Margin="5" Text="等距分布"/>
                        <StackPanel Orientation="Horizontal">
                            <Fluent:Button Margin="5" Command="{Binding DistributeHorizontalCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/DistributeObjectsHorizontal.png"/>
                            <Fluent:Button Margin="5" Command="{Binding DistributeVerticalCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/DistributeObjectsVertical.png"/>
                        </StackPanel>
                    </Fluent:DropDownButton>
                    <Fluent:DropDownButton Header="翻转" Icon="{iconPacks:VaadinIcons Kind=FlipH}" Width="50" VerticalAlignment="Top" IsEnabled="{Binding SelectedItem.ShowRotate}">
                        <Fluent:DropDownButton.LargeIcon>
                            <iconPacks:PackIconVaadinIcons Kind="FlipH" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:DropDownButton.LargeIcon>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Margin="5" Text="镜像" VerticalAlignment="Center"/>
                            <Fluent:ToggleButton IsChecked="{Binding SelectedItem.ScaleX,Converter={dd:ConverterValueMapToBool Parameter='1'}, ConverterParameter='-1'}" 
                                                 Margin="5" Size="Small" Icon="{iconPacks:Material Kind=FlipHorizontal}"/>
                            <Fluent:ToggleButton IsChecked="{Binding SelectedItem.ScaleY,Converter={dd:ConverterValueMapToBool Parameter='1'}, ConverterParameter='-1'}" 
                                                 Margin="5" Size="Small" Icon="{iconPacks:Material Kind=FlipVertical}"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Margin="5" Text="旋转" VerticalAlignment="Center"/>
                            <controls:SliderRotation Value="{Binding SelectedItem.Angle,Mode=TwoWay}"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding SelectedItem.Angle,Mode=TwoWay}" Maximum="359" Minimum="0"
                                    Format="0 deg" />
                        </StackPanel>
                    </Fluent:DropDownButton>
                    <Fluent:DropDownButton Header="大小" Icon="{iconPacks:FontAwesome Kind=ArrowsAltSolid}" Width="50" VerticalAlignment="Top">
                        <Fluent:DropDownButton.LargeIcon>
                            <iconPacks:PackIconFontAwesome Kind="ExpandArrowsAltSolid" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:DropDownButton.LargeIcon>
                        <TextBlock Margin="5" Text="大小" />
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Margin="5" Text="宽" Width="15" VerticalAlignment="Center"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding SelectedItem.ItemWidth,Mode=TwoWay}" Minimum="0"
                                    Format="0" />
                            <TextBlock Margin="5" Text="高" Width="15" VerticalAlignment="Center"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding SelectedItem.ItemHeight,Mode=TwoWay}" Minimum="0"
                                    Format="0" />
                        </StackPanel>
                        <TextBlock Margin="5" Text="X/Y位置"/>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Margin="5" Text="X" Width="15" VerticalAlignment="Center"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding SelectedItem.Left,Mode=TwoWay}" Minimum="0"
                                    Format="0" />
                            <TextBlock Margin="5" Text="Y" Width="15" VerticalAlignment="Center"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding SelectedItem.Top,Mode=TwoWay}" Minimum="0"
                                    Format="0" />
                        </StackPanel>
                        <Separator />
                        <TextBlock Margin="5" Text="等大小"/>
                        <UniformGrid Rows="1">
                            <Fluent:Button Margin="5" ToolTip="等宽" Command="{Binding SameWidthCommand}" CommandParameter="{Binding SelectedItem}" Size="Small" Icon="{iconPacks:FontAwesome Kind=ArrowsAltHSolid}"/>
                            <Fluent:Button Margin="5" ToolTip="等高" Command="{Binding SameHeightCommand}" CommandParameter="{Binding SelectedItem}" Size="Small" Icon="{iconPacks:FontAwesome Kind=ArrowsAltVSolid}"/>
                            <Fluent:Button Margin="5" ToolTip="等大小" Command="{Binding SameSizeCommand}" CommandParameter="{Binding SelectedItem}" Size="Small" Icon="{iconPacks:FontAwesome Kind=ArrowsAltSolid}"/>
                            <Fluent:Button Margin="5" ToolTip="等角度" Command="{Binding SameAngleCommand}" CommandParameter="{Binding SelectedItem}" Size="Small" Icon="{iconPacks:Material Kind=AngleAcute}"/>
                        </UniformGrid>
                    </Fluent:DropDownButton>


                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="颜色"
                                       IsLauncherVisible="True" >
                    <Fluent:SplitButton Header="填充" SizeDefinition="Middle" MaxDropDownHeight="500">
                        <Fluent:SplitButton.Icon>
                            <Grid>
                                <iconPacks:PackIconMaterial Kind="FormatColorFill" />
                                <Rectangle VerticalAlignment="Bottom"
                                               Height="4"
                                               Width="16"
                                               HorizontalAlignment="Center">
                                    <Rectangle.Fill>
                                        <SolidColorBrush Color="{Binding ColorViewModel.FillColor.Color}" />
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Grid>
                        </Fluent:SplitButton.Icon>
                        <Fluent:ColorGallery ThemeColorsSource="{Binding ColorViewModel.FillColors}"
                                                 SelectedColor="{Binding ColorViewModel.FillColor.Color, Mode=TwoWay}"
                                                 Mode="ThemeColors"
                                                 StandardColorGridRows="3"
                                                 Columns="10"
                                                 ThemeColorGridRows="5"
                                                 IsNoColorButtonVisible="True" />
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="FillColor"
                                              Text="填充颜色"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="线条" SizeDefinition="Middle" MaxDropDownHeight="500">
                        <Fluent:SplitButton.Icon>
                            <Grid>
                                <iconPacks:PackIconMaterial Kind="Pencil" />
                                <Rectangle VerticalAlignment="Bottom"
                                               Height="4"
                                               Width="16"
                                               HorizontalAlignment="Center">
                                    <Rectangle.Fill>
                                        <SolidColorBrush Color="{Binding ColorViewModel.LineColor.Color}" />
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Grid>
                        </Fluent:SplitButton.Icon>
                        <Fluent:ColorGallery ThemeColorsSource="{Binding ColorViewModel.LineColors}"
                                                 SelectedColor="{Binding ColorViewModel.LineColor.Color, Mode=TwoWay}"
                                                 Mode="ThemeColors"
                                                 StandardColorGridRows="3"
                                                 Columns="10"
                                                 ThemeColorGridRows="5"
                                                 IsNoColorButtonVisible="True" />
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="LineColor"
                                              Text="线条颜色"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="阴影" SizeDefinition="Middle" MaxDropDownHeight="500">
                        <Fluent:SplitButton.Icon>
                            <Grid>
                                <iconPacks:PackIconMaterial Kind="BoxShadow" />
                                <Rectangle VerticalAlignment="Bottom"
                                               Height="4"
                                               Width="16"
                                               HorizontalAlignment="Center">
                                    <Rectangle.Fill>
                                        <SolidColorBrush Color="{Binding ColorViewModel.ShadowColor}" />
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Grid>
                        </Fluent:SplitButton.Icon>
                        <Fluent:ColorGallery Mode="StandardColors"
                                                 SelectedColor="{Binding ColorViewModel.ShadowColor, Mode=TwoWay}" />
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="ShadowColor"
                                              Text="阴影颜色"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>

                    <Fluent:DropDownButton Header="样式" SizeDefinition="Middle" MaxDropDownHeight="500" Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Images/line-dashed.png">
                        <TextBlock Text="线条样式" FontSize="16" FontWeight="Black" Margin="5"/>
                        <StackPanel Orientation="Horizontal">
                            <StackPanel>
                                <TextBlock Text="线条宽度" Margin="5"/>
                                <Fluent:Spinner Width="140" Size="Small" Margin="5"
                                    Value="{Binding ColorViewModel.LineWidth}"
                                    Format="0 pt" />
                            </StackPanel>
                            <StackPanel>
                                <TextBlock Text="箭头样式" Margin="5"/>
                                <StackPanel Orientation="Horizontal">
                                    <Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowPathStyle}" SelectedItem="{Binding ColorViewModel.LeftArrowPathStyle}">
                                        <Fluent:ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <DockPanel>
                                                    <Grid>
                                                        <Line X1="0" Y1="0" X2="100" Y2="0" Stroke="Black" StrokeThickness="1" VerticalAlignment="Center"  />
                                                        <Path
                                                    Data="{Binding .,Converter={StaticResource ArrowPathConverter}}"
                                                    HorizontalAlignment="Left"
                                                    Width="10"
                                                    Height="10"
                                                    Stretch="Fill"
                                                    Stroke="Black"
                                                    Fill="Black"
                                                    VerticalAlignment="Center"                                      
                                                    RenderTransformOrigin="0.5,0.5">
                                                            <Path.RenderTransform>
                                                                <RotateTransform x:Name="rightrot" Angle="-90" />
                                                            </Path.RenderTransform>
                                                        </Path>
                                                    </Grid>
                                                    <TextBlock DockPanel.Dock="Right" Margin="2,0" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplatedParent.(ItemsControl.AlternationIndex),Converter={StaticResource NumberConverter}}"></TextBlock>
                                                </DockPanel>
                                            </DataTemplate>
                                        </Fluent:ComboBox.ItemTemplate>
                                    </Fluent:ComboBox>
                                    <Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowPathStyle}" SelectedItem="{Binding ColorViewModel.RightArrowPathStyle}">
                                        <Fluent:ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <DockPanel>
                                                    <Grid>
                                                        <Line X1="0" Y1="0" X2="100" Y2="0" Stroke="Black" StrokeThickness="1" VerticalAlignment="Center"  />
                                                        <Path
                                                    Data="{Binding .,Converter={StaticResource ArrowPathConverter}}"
                                                    HorizontalAlignment="Right"
                                                    Width="10"
                                                    Height="10"
                                                    Stretch="Fill"
                                                    Stroke="Black"
                                                    Fill="Black"
                                                    VerticalAlignment="Center"                                      
                                                    RenderTransformOrigin="0.5,0.5">
                                                            <Path.RenderTransform>
                                                                <RotateTransform x:Name="rightrot" Angle="90" />
                                                            </Path.RenderTransform>
                                                        </Path>
                                                    </Grid>
                                                    <TextBlock DockPanel.Dock="Right" Margin="2,0" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplatedParent.(ItemsControl.AlternationIndex),Converter={StaticResource NumberConverter}}"></TextBlock>
                                                </DockPanel>
                                            </DataTemplate>
                                        </Fluent:ComboBox.ItemTemplate>
                                    </Fluent:ComboBox>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <StackPanel>
                                <TextBlock Text="圆角大小" Margin="5"/>
                                <Fluent:Spinner IsEnabled="False" Width="140" Size="Small" Margin="5"
                                    Format="0 mm" />
                            </StackPanel>
                            <StackPanel>
                                <TextBlock Text="箭头样式" Margin="5"/>
                                <StackPanel Orientation="Horizontal">
                                    <Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowSizeStyle}" SelectedItem="{Binding ColorViewModel.LeftArrowSizeStyle}">
                                        <Fluent:ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
                                            </DataTemplate>
                                        </Fluent:ComboBox.ItemTemplate>
                                    </Fluent:ComboBox>
                                    <Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:ArrowSizeStyle}" SelectedItem="{Binding ColorViewModel.RightArrowSizeStyle}">
                                        <Fluent:ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
                                            </DataTemplate>
                                        </Fluent:ComboBox.ItemTemplate>
                                    </Fluent:ComboBox>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <StackPanel>
                                <TextBlock Text="线条样式" Margin="5"/>
                                <Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:LineDashStyle}" SelectedItem="{Binding ColorViewModel.LineDashStyle}">
                                    <Fluent:ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <DockPanel>
                                                <Grid>
                                                    <Line X1="0" Y1="0" X2="100" Y2="0" Stroke="Black" StrokeThickness="1" StrokeDashArray="{Binding .,Converter={StaticResource LineDashConverter}}" VerticalAlignment="Center"  />
                                                </Grid>
                                                <TextBlock DockPanel.Dock="Right" Margin="2,0" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplatedParent.(ItemsControl.AlternationIndex),Converter={StaticResource NumberConverter}}"></TextBlock>
                                            </DockPanel>
                                        </DataTemplate>
                                    </Fluent:ComboBox.ItemTemplate>
                                </Fluent:ComboBox>
                            </StackPanel>
                        </StackPanel>
                        <Fluent:DropDownButton.ToolTip>
                            <Fluent:ScreenTip Title="LineStyle"
                                              Text="线条样式"
                                              Width="190" />
                        </Fluent:DropDownButton.ToolTip>
                    </Fluent:DropDownButton>

                    <Fluent:SplitButton IsCheckable="True" IsChecked="{Binding LockObjectViewModel.LockObject[0].IsChecked}" SizeDefinition="Middle" MaxDropDownHeight="500">
                        <Fluent:SplitButton.Style>
                            <Style TargetType="{x:Type Fluent:SplitButton}" BasedOn="{StaticResource RibbonSplitButtonStyle}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding LockObjectViewModel.LockObject[0].IsChecked}" Value="false">
                                        <Setter Property="Icon" Value="{iconPacks:Material Kind=LockOpen}"/>
                                        <Setter Property="Header" Value="锁定" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding LockObjectViewModel.LockObject[0].IsChecked}" Value="true">
                                        <Setter Property="Icon" Value="{iconPacks:Material Kind=Lock}"/>
                                        <Setter Property="Header" Value="解锁" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Fluent:SplitButton.Style>
                        <ItemsControl ItemsSource="{Binding LockObjectViewModel.LockObject}" BorderThickness="0">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Fluent:MenuItem Header="{Binding LockFlag,Converter={StaticResource EnumDescriptionConverter}}" Size="Middle" IsCheckable="True" IsChecked="{Binding IsChecked}"  />
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                        <Fluent:MenuItem Header="取消所有保护" Size="Middle" Command="{Binding UnlockCommand}" />
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Lock"
                                              Text="锁定与解锁"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>

                    <Fluent:Button Header="居中" Size="Middle" Icon="{iconPacks:Material Kind=ImageFilterCenterFocus}" Command="{Binding CenterCommand}" >
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="CenterAlign"
                                              Text="元素居中"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="快速样式"
                                       IsLauncherVisible="True">
                    <!--InRibbonGallery-->
                    <Fluent:InRibbonGallery x:Name="quickThemeGallery"
                                            MinItemsInRow="3"
                                            MaxItemsInRow="8"
                                            MaxItemsInDropDownRow="8"
                                            Icon="Images\Gray.png"
                                            Header="InRibbonGallery"
                                            ItemWidth="45"
                                            ItemHeight="56"
                                            ItemsSource="{Binding QuickThemeViewModel.QuickThemes}"
                                            SelectedItem="{Binding QuickThemeViewModel.QuickTheme}"
                                            ResizeMode="Both"
                                            Selectable="False">
                        <Fluent:InRibbonGallery.ItemTemplate>
                            <DataTemplate>
                                <Border ToolTip="{Binding Text}" BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" BorderThickness="{Binding ColorViewModel.LineWidth,Converter={StaticResource DoubleToThickness}}" Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}" Margin="5,10" CornerRadius="3">
                                    <TextBlock Text="{Binding Text}" Foreground="{Binding FontViewModel.FontColor,Converter={StaticResource ColorBrushConverter}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                            </DataTemplate>
                        </Fluent:InRibbonGallery.ItemTemplate>
                    </Fluent:InRibbonGallery>
                    <Fluent:RibbonGroupBox.ToolTip>
                        <Fluent:ScreenTip Title="CenterAlign"
                                              Text="快速样式"
                                              Width="190" />
                    </Fluent:RibbonGroupBox.ToolTip>
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="其它"
                                       IsLauncherVisible="True"   >
                    <Fluent:Button Size="Small" Icon="{iconPacks:FontAwesome Kind=SearchSolid}">
                    </Fluent:Button>
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="插入">
                <Fluent:RibbonGroupBox Header="插入"
                                       IsLauncherVisible="True">
                    <Fluent:SplitButton Header="空白页" Width="50" VerticalAlignment="Top" Command="{Binding AddPageCommand}">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="FileOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:MenuItem Header="空白页" Size="Middle" Command="{Binding AddPageCommand}" Icon="{iconPacks:Material Kind=FileOutline}"/>
                        <Fluent:MenuItem Header="复制本页" Size="Middle" Command="{Binding AddCopyPageCommand}" Icon="{iconPacks:Material Kind=ContentCopy}"/>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="InsertPage"
                                              Text="插入页面"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="表格" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="TableLarge" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <controls:RectangleGrid x:Name="rec" ColumnNum="10" RowNum="8" />
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="InsertTable"
                                              Text="插入表格(暂未实现)"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:Button Header="图片" Width="50" VerticalAlignment="Top" Command="{Binding AddImageCommand}">
                        <Fluent:Button.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="Image" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:Button.LargeIcon>
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="InsertImage"
                                              Text="插入图片"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                    <Fluent:Button Header="图表" Width="50" VerticalAlignment="Top">
                        <Fluent:Button.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="ChartLine" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:Button.LargeIcon>
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="InsertChart"
                                              Text="插入图表(暂未实现)"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                    <Fluent:Button Header="矢量文本" Width="50" VerticalAlignment="Top" Command="{Binding AddOutLineTextCommand}">
                        <Fluent:Button.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="FormatTextVariantOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:Button.LargeIcon>
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="InsertOutLineText"
                                              Text="插入矢量文本"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                    <Fluent:SplitButton Header="符号" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="Symbol" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="InsertOutLineText"
                                              Text="插入符号(暂未实现)"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:Button Header="二维码" Width="50" VerticalAlignment="Top" Command="{Binding AddBarcodeCommand}" CommandParameter="QR_CODE">
                        <Fluent:Button.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="Qrcode" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:Button.LargeIcon>
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="InsertQrcode"
                                              Text="插入二维码"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="附件"
                                       IsLauncherVisible="True" >
                    <Fluent:SplitButton Header="超链接" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="LinkVariant" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="InsertLink"
                                              Text="插入超链接(暂未实现)"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="附件" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="Paperclip" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="InsertAppendix"
                                              Text="插入附件(暂未实现)"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="注释" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="ChatProcessingOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="InsertChat"
                                              Text="插入注释(暂未实现)"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="评论" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="CommentProcessingOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="InsertCommit"
                                              Text="插入评论(暂未实现)"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="页面布局">
                <Fluent:RibbonGroupBox Header="页面"
                                       IsLauncherVisible="True">

                    <Fluent:SplitButton Header="大小" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <Grid>
                                <iconPacks:PackIconMaterial Kind="FileOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                <TextBlock Text="S" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="9"/>
                            </Grid>
                        </Fluent:SplitButton.LargeIcon>
                        <ListBox BorderThickness="0" helper:EnumHelper.Enum="{x:Type dd:PageSizeType}" SelectedItem="{Binding DiagramsViewModel.DiagramViewModel.PageSizeType}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" Margin="5"/>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="PageSize"
                                              Text="页面大小"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="方向" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="PhoneRotateLandscape" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <ListBox BorderThickness="0" helper:EnumHelper.Enum="{x:Type dd:PageSizeOrientation}" SelectedItem="{Binding DiagramsViewModel.DiagramViewModel.PageSizeOrientation}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" Margin="5"/>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="PageOrientation"
                                              Text="页面方向"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="单位" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="RulerSquare" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <ListBox BorderThickness="0" helper:EnumHelper.Enum="{x:Type dd:PageUnit}" SelectedItem="{Binding DiagramsViewModel.DiagramViewModel.PageUnit}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" Margin="5"/>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="PageUnit"
                                              Text="单位"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="页码" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="Numeric1BoxMultipleOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="PageNumber"
                                              Text="页码(暂未实现)"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="网格" Width="50" VerticalAlignment="Top" IsCheckable="True" IsChecked="{Binding DiagramsViewModel.ShowGrid}" >
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="Grid" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Margin="5" Text="宽度" VerticalAlignment="Center"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding DiagramsViewModel.DiagramViewModel.GridCellWidth,Mode=TwoWay}" Minimum="0" Format="0" />
                            <TextBlock Margin="5" Text="高度" VerticalAlignment="Center"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding DiagramsViewModel.DiagramViewModel.GridCellHeight,Mode=TwoWay}" Minimum="0" Format="0" />
                        </StackPanel>
                        
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="ShowGrid"
                                              Text="显示网格"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="横对齐" Width="50" VerticalAlignment="Top">
                        <UniformGrid Rows="4">
                            <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding DiagramsViewModel.DiagramViewModel.CellHorizontalAlignment,Converter={dd:ConverterValueMapToBool Parameter='Left'}, ConverterParameter='Left'}" ToolTip="左对齐">
                                <Fluent:ToggleButton.LargeIcon>
                                    <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                        <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignLeft" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                                    </Border>
                                </Fluent:ToggleButton.LargeIcon>
                            </Fluent:ToggleButton>
                            <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding DiagramsViewModel.DiagramViewModel.CellHorizontalAlignment,Converter={dd:ConverterValueMapToBool Parameter='Center'}, ConverterParameter='Center'}" ToolTip="居中对齐">
                                <Fluent:ToggleButton.LargeIcon>
                                    <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                        <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignCenter" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                    </Border>
                                </Fluent:ToggleButton.LargeIcon>
                            </Fluent:ToggleButton>
                            <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding DiagramsViewModel.DiagramViewModel.CellHorizontalAlignment,Converter={dd:ConverterValueMapToBool Parameter='Right'}, ConverterParameter='Right'}" ToolTip="右对齐">
                                <Fluent:ToggleButton.LargeIcon>
                                    <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                        <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignRight" VerticalAlignment="Center" HorizontalAlignment="Right"/>
                                    </Border>
                                </Fluent:ToggleButton.LargeIcon>
                            </Fluent:ToggleButton>
                            <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding DiagramsViewModel.DiagramViewModel.CellHorizontalAlignment,Converter={dd:ConverterValueMapToBool Parameter='None'}, ConverterParameter='None'}" ToolTip="无对齐">
                                <Fluent:ToggleButton.LargeIcon>
                                    <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                        <TextBlock Text="无" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </Fluent:ToggleButton.LargeIcon>
                            </Fluent:ToggleButton>      
                        </UniformGrid>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="ShowGrid"
                                              Text="横向对齐到网格方式"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                        <Fluent:SplitButton.Style>
                            <Style TargetType="{x:Type Fluent:SplitButton}" BasedOn="{StaticResource RibbonSplitButtonStyle}">
                                <Setter Property="LargeIcon">
                                    <Setter.Value>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                            <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignLeft" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                                        </Border>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding DiagramsViewModel.DiagramViewModel.CellHorizontalAlignment}" Value="Left">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                                    <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignLeft" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                                                </Border>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DiagramsViewModel.DiagramViewModel.CellHorizontalAlignment}" Value="Center">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                                    <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignCenter" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                                </Border>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DiagramsViewModel.DiagramViewModel.CellHorizontalAlignment}" Value="Right">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                                    <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignRight" VerticalAlignment="Center" HorizontalAlignment="Right"/>
                                                </Border>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DiagramsViewModel.DiagramViewModel.CellHorizontalAlignment}" Value="None">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                                    <TextBlock Text="无" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                </Border>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Fluent:SplitButton.Style>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="竖对齐" Width="50" VerticalAlignment="Top">
                        <UniformGrid Columns="4">
                            <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding DiagramsViewModel.DiagramViewModel.CellVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='Top'}, ConverterParameter='Top'}" ToolTip="上对齐">
                                <Fluent:ToggleButton.LargeIcon>
                                    <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                        <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignLeft" RotationAngle="90" VerticalAlignment="Top" HorizontalAlignment="Center"/>
                                    </Border>
                                </Fluent:ToggleButton.LargeIcon>
                            </Fluent:ToggleButton>
                            <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding DiagramsViewModel.DiagramViewModel.CellVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='Center'}, ConverterParameter='Center'}" ToolTip="居中对齐">
                                <Fluent:ToggleButton.LargeIcon>
                                    <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                        <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignCenter" RotationAngle="90" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                    </Border>
                                </Fluent:ToggleButton.LargeIcon>
                            </Fluent:ToggleButton>
                            <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding DiagramsViewModel.DiagramViewModel.CellVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='Bottom'}, ConverterParameter='Bottom'}" ToolTip="下对齐">
                                <Fluent:ToggleButton.LargeIcon>
                                    <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                        <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignRight" RotationAngle="90" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>
                                    </Border>
                                </Fluent:ToggleButton.LargeIcon>
                            </Fluent:ToggleButton>
                            <Fluent:ToggleButton Height="48" Width="48" SizeDefinition="Large" IsChecked="{Binding DiagramsViewModel.DiagramViewModel.CellVerticalAlignment,Converter={dd:ConverterValueMapToBool Parameter='None'}, ConverterParameter='None'}" ToolTip="无对齐">
                                <Fluent:ToggleButton.LargeIcon>
                                    <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                        <TextBlock Text="无" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </Fluent:ToggleButton.LargeIcon>
                            </Fluent:ToggleButton>
                        </UniformGrid>
                        <Fluent:SplitButton.Style>
                            <Style TargetType="{x:Type Fluent:SplitButton}" BasedOn="{StaticResource RibbonSplitButtonStyle}">
                                <Setter Property="LargeIcon">
                                    <Setter.Value>
                                        <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                            <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignLeft" RotationAngle="90" VerticalAlignment="Top" HorizontalAlignment="Center"/>
                                        </Border>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding DiagramsViewModel.DiagramViewModel.CellVerticalAlignment}" Value="Top">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                                    <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignLeft" RotationAngle="90" VerticalAlignment="Top" HorizontalAlignment="Center"/>
                                                </Border>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DiagramsViewModel.DiagramViewModel.CellVerticalAlignment}" Value="Center">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                                    <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignCenter" RotationAngle="90" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                                </Border>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DiagramsViewModel.DiagramViewModel.CellVerticalAlignment}" Value="Bottom">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                                    <iconPacks:PackIconMaterial Foreground="Gray" Kind="FormatAlignRight" RotationAngle="90" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>
                                                </Border>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DiagramsViewModel.DiagramViewModel.CellVerticalAlignment}" Value="None">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <Border BorderThickness="1" BorderBrush="Gray" Margin="6,6,6,6">
                                                    <TextBlock Text="无" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                </Border>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Fluent:SplitButton.Style>                      
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="ShowGrid"
                                              Text="竖向对齐到网格方式"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>

                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="背景"
                                       IsLauncherVisible="True" >
                    <Fluent:SplitButton Header="水印" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <Grid>
                                <iconPacks:PackIconMaterial Kind="FileOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                <TextBlock Text="W" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="9"/>
                            </Grid>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Watermark"
                                              Text="水印(暂未实现)"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="背景" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="File" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:ColorGallery     SelectedColor="{Binding DiagramsViewModel.DiagramViewModel.PageBackground, Mode=TwoWay}"
                                                 Mode="StandardColors"
                                                 StandardColorGridRows="3"
                                                 Columns="10"
                                                 ThemeColorGridRows="5"
                                                 IsNoColorButtonVisible="True" />
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Background"
                                              Text="背景"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="帮助">
                <Fluent:RibbonGroupBox>
                    <Fluent:SplitButton Header="指引" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="BookOpenVariant" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Guide"
                                              Text="指引(暂未完成)"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox>
                    <Fluent:SplitButton Header="主页" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="BookOpenVariant" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Url"
                                              Text="主页(暂未完成)"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="反馈" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="BookOpenVariant" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="FeedBack"
                                              Text="反馈(暂未完成)"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:Button Header="关于" Width="50" VerticalAlignment="Top" Command="{Binding AboutCommand}">
                        <Fluent:Button.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="InformationOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:Button.LargeIcon>
                    </Fluent:Button>
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
        </Fluent:Ribbon>

        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <views:ToolBoxControl x:Name="toolBox" DataContext="{Binding ToolBoxViewModel}"/>
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="48" Text="欢迎访问AIStudio画板" Foreground="{DynamicResource GrayBrush2}"/>
                <dragablz:TabablzControl x:Name="table" 
                                     ItemsSource="{Binding DiagramsViewModels}" 
                                     SelectedItem="{Binding DiagramsViewModel}"
                                     Background="Transparent"
                                     ItemContainerStyle="{StaticResource TrapezoidDragableTabItemStyle}"  
                                     ShowDefaultCloseButton="True"  
                                     ShowDefaultAddButton="False"
                                     NewItemFactory="{Binding NewItemFactory}"
                                     ClosingItemCallback="{Binding ClosingTabItemHandler}"
                                     AdjacentHeaderItemOffset="-10">
                    <dragablz:TabablzControl.HeaderPrefixContent>
                        <ToggleButton x:Name="toggle" HorizontalAlignment="Center" IsChecked="{Binding ElementName=toolBox,Path=IsExpanded}" 
                                      Visibility="{Binding ElementName=toolBox,Path=IsExpanded,Converter={StaticResource Boolean2VisibilityReConverter}}" 
                                      Background="{DynamicResource WhiteBrush}"  Style="{StaticResource DefaultToggleButton}">
                            <Path Fill="Black" Stretch="Fill" Width="16" Height="16" Margin="10,3" Data="M5.59,7.41L7,6L13,12L7,18L5.59,16.59L10.17,12L5.59,7.41M11.59,7.41L13,6L19,12L13,18L11.59,16.59L16.17,12L11.59,7.41Z"/>
                        </ToggleButton>
                    </dragablz:TabablzControl.HeaderPrefixContent>
                    <dragablz:TabablzControl.HeaderItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Title}"/>
                                <TextBlock Text="{Binding Status}"/>
                            </StackPanel>
                        </DataTemplate>
                    </dragablz:TabablzControl.HeaderItemTemplate>
                    <dragablz:TabablzControl.ContentTemplate>
                        <DataTemplate>
                            <TabControl ItemsSource="{Binding DiagramViewModels}" SelectedItem="{Binding DiagramViewModel}" Style="{StaticResource TabControlStyle}"
                                        BorderThickness="0" Margin="0" Padding="0">
                                <TabControl.ItemContainerStyle>
                                    <Style>
                                        <Setter Property="TabItem.Visibility" Value="Collapsed"/>
                                    </Style>
                                </TabControl.ItemContainerStyle>
                                <TabControl.ContentTemplate>
                                    <DataTemplate>
                                        <ScrollViewer x:Name="designerScrollViewer" 
                                              Background="{DynamicResource GrayBrush8}"
                                              HorizontalScrollBarVisibility="Auto"
                                              VerticalScrollBarVisibility="Auto">
                                            <DockPanel x:Name="panel">
                                                <controls:Ruler x:Name="hruler"  
                                                       Unit="{Binding PageUnit,Converter={StaticResource RulerUnitConverter}}"                                       
                                                       DockPanel.Dock="Top"
                                                       Margin="21,0,0,0"
                                                       Zoom="{Binding ZoomValue}"                                                  
                                                       AutoSize="True"
                                                       ClipToBounds="True" >
                                                    <controls:Ruler.CountShift>
                                                        <MultiBinding Converter="{StaticResource CountShiftConverter}" ConverterParameter="X">
                                                            <Binding ElementName="diagram" Path="." />
                                                            <Binding ElementName="diagram" Path="ZoomValue"/>
                                                            <Binding Path="PageUnit"/>
                                                            <Binding ElementName="designerScrollViewer" Path="ActualWidth"/>
                                                            <Binding ElementName="panel" Path="ActualWidth"/>
                                                            <Binding ElementName="diagram" Path="ActualWidth"/>
                                                        </MultiBinding>
                                                    </controls:Ruler.CountShift>
                                                </controls:Ruler>
                                                <controls:Ruler x:Name="vruler"
                                                       Unit="{Binding PageUnit,Converter={StaticResource RulerUnitConverter}}"
                                                       Marks="Up"
                                                       RenderTransformOrigin="0,0"
                                                       AutoSize="True"
                                                       Zoom="{Binding ZoomValue}"                                                     
                                                       ClipToBounds="True">
                                                    <controls:Ruler.LayoutTransform>
                                                        <TransformGroup>
                                                            <ScaleTransform ScaleX="1" ScaleY="1" />
                                                            <SkewTransform AngleX="0" AngleY="0" />
                                                            <RotateTransform Angle="90" />
                                                            <TranslateTransform X="23" />
                                                        </TransformGroup>
                                                    </controls:Ruler.LayoutTransform>
                                                    <controls:Ruler.CountShift>
                                                        <MultiBinding Converter="{StaticResource CountShiftConverter}" ConverterParameter="Y">
                                                            <Binding ElementName="diagram" Path="." />
                                                            <Binding ElementName="diagram" Path="ZoomValue" />
                                                            <Binding Path="PageUnit"/>
                                                            <Binding ElementName="designerScrollViewer" Path="ActualHeight"/>
                                                            <Binding ElementName="panel" Path="ActualHeight"/>
                                                            <Binding ElementName="diagram" Path="ActualHeight"/>
                                                        </MultiBinding>
                                                    </controls:Ruler.CountShift>
                                                </controls:Ruler>
                                                <dd:DiagramControl x:Name="diagram" DataContext="{Binding .}" Margin="50"/>
                                            </DockPanel>
                                        </ScrollViewer>
                                    </DataTemplate>
                                </TabControl.ContentTemplate>
                            </TabControl>
                        </DataTemplate>
                    </dragablz:TabablzControl.ContentTemplate>
                </dragablz:TabablzControl>

                <DockPanel Grid.Row="1" >
                    <Fluent:ComboBox Size="Small" IsEditable="False" helper:EnumHelper.Enum="{x:Type model:ColorType}"  SelectedItem="{Binding ColorType}" BorderThickness="0" BorderBrush="Transparent" Background="Transparent" Template="{StaticResource ComboboxControlTemplate1}" >
                        <Fluent:ComboBox.ItemTemplate>
                            <DataTemplate>
                                <iconPacks:PackIconMaterial x:Name="icon" Kind="FormatColorText"  Width="12" Height="12" Margin="2"/>
                                <DataTemplate.Triggers>
                                    <DataTrigger Binding="{Binding .}" Value="Fill">
                                        <Setter TargetName="icon" Property="Kind" Value="FormatColorFill"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding .}" Value="Line">
                                        <Setter TargetName="icon" Property="Kind" Value="Pencil"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding .}" Value="Text">
                                        <Setter TargetName="icon" Property="Kind" Value="FormatColorText"/>
                                    </DataTrigger>
                                </DataTemplate.Triggers>
                            </DataTemplate>
                        </Fluent:ComboBox.ItemTemplate>
                    </Fluent:ComboBox>
                    <ListBox x:Name="listColor" ItemsSource="{Binding StandardColor}" DockPanel.Dock="Right"
                         ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
                         Padding="0"                            
                         ItemContainerStyle="{StaticResource UnSelectedItemContainerStyle}"
                         Style="{StaticResource ColorGalleryListBox}">
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <UniformGrid Rows="1"></UniformGrid>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="PreviewMouseLeftButtonUp">
                                <i:InvokeCommandAction Command="{Binding SelectedColorCommand}" CommandParameter="{Binding Path=SelectedItem, ElementName=listColor}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </ListBox>
                </DockPanel>
            </Grid>
            <views:PropertyControl Grid.Column="2" />
        </Grid>

        <Fluent:StatusBar HorizontalAlignment="Stretch"
                          VerticalAlignment="Bottom"
                          Visibility="{Binding IsChecked, ElementName=IsStatusBarVisibleCheckBox, Converter={StaticResource boolToVisibilityConverter}}"
                          Grid.Row="2">
            <Fluent:StatusBarItem Title="Page" HorizontalAlignment="Left">
                <StackPanel Orientation="Horizontal">
                    <ListBox ItemsSource="{Binding DiagramsViewModel.DiagramViewModels}"
                         SelectedItem="{Binding DiagramsViewModel.DiagramViewModel}"
                         ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
                         HorizontalAlignment="Center"
                         BorderBrush="Transparent"
                         Padding="0"
                         Background="Transparent"
                         drop:DragDrop.CanDragWithMouseRightButton="True"
                         drop:DragDrop.IsDragSource="True"
                         drop:DragDrop.IsDropTarget="True"
                         drop:DragDrop.DropTargetAdornerBrush="Coral"
                         drop:DragDrop.UseDefaultEffectDataTemplate="True">
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <WrapPanel Orientation="Horizontal"/>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ContextMenu>
                                        <ContextMenu>
                                            <MenuItem Header="增加页" Command="{binding:ControlBinding AddPageCommand}" CommandParameter="{Binding .}"/>
                                            <MenuItem Header="复制页" Command="{binding:ControlBinding AddCopyPageCommand}" CommandParameter="{Binding .}"/>
                                            <MenuItem Header="重命名页" Command="{binding:ControlBinding RenamePageCommand}" CommandParameter="{Binding .}"/>
                                            <MenuItem Header="删除页" Command="{binding:ControlBinding DeletePageCommand}" CommandParameter="{Binding .}"/>
                                        </ContextMenu>
                                    </Grid.ContextMenu>
                                    <TextBlock Text="{Binding Name}" Visibility="{Binding IsEditName,Converter={StaticResource Boolean2VisibilityReConverter}}">
                                        <TextBlock.InputBindings>
                                            <MouseBinding MouseAction="LeftDoubleClick" Command="{binding:ControlBinding RenamePageCommand}" CommandParameter="{Binding .}"/>
                                        </TextBlock.InputBindings>
                                    </TextBlock>
                                    <TextBox x:Name="renametextbox" Text="{Binding Name,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding IsEditName,Converter={StaticResource BooleanToVisibilityConverter}}">
                                        <TextBox.InputBindings>
                                            <KeyBinding Key="Enter"  Command="{binding:ControlBinding EndRenamePageCommand}" CommandParameter="{Binding .}"/>
                                        </TextBox.InputBindings>
                                        <TextBox.Style>
                                            <Style TargetType="TextBox">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding Visibility,ElementName=renametextbox}" Value="Visible">
                                                        <Setter Property="FocusManager.FocusedElement" Value="{Binding ElementName=renametextbox}"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </TextBox.Style>
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="LostFocus">
                                                <i:InvokeCommandAction Command="{binding:ControlBinding EndRenamePageCommand}" CommandParameter="{Binding .}" />
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </TextBox>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <Fluent:Button Size="Small" Icon="{iconPacks:Material Kind=Plus}"
                                     Command="{Binding AddPageCommand}"/>
                </StackPanel>
            </Fluent:StatusBarItem>

            <Separator HorizontalAlignment="Left" />

            <Fluent:StatusBarItem Title="Color"  Visibility="{Binding SelectedItem,Converter={StaticResource NullableToVisibilityConverter}}"
                                  HorizontalAlignment="Right" >
                <StackPanel Orientation="Horizontal" >
                    <TextBlock>形状ID：</TextBlock>
                    <TextBox BorderThickness="0" IsReadOnly="True" Background="Transparent" Foreground="White"
                             Text="{Binding SelectedItem.Id}"/>
                </StackPanel>
            </Fluent:StatusBarItem>

            <Separator HorizontalAlignment="Right" />

            <Fluent:StatusBarItem Title="Mouse" HorizontalAlignment="Right" >
                <StackPanel Orientation="Horizontal">
                    <TextBlock VerticalAlignment="Center" Width="150">
                        <Run>鼠标位置：</Run>
                        <Run Text="{Binding DiagramsViewModel.DiagramViewModel.CurrentPoint.X,StringFormat=f1}"/>
                         <Run>,</Run>
                        <Run Text="{Binding DiagramsViewModel.DiagramViewModel.CurrentPoint.Y,StringFormat=f1}"/>
                    </TextBlock>
                    <Rectangle Width="12" Height="12" Margin="5" VerticalAlignment="Center">
                        <Rectangle.Fill>
                            <SolidColorBrush Color="{Binding DiagramsViewModel.DiagramViewModel.CurrentColor}" />
                        </Rectangle.Fill>
                    </Rectangle>
                    <TextBlock Width="66" VerticalAlignment="Center" Text="{Binding DiagramsViewModel.DiagramViewModel.CurrentColor}" />
                </StackPanel>
            </Fluent:StatusBarItem>

            <Separator HorizontalAlignment="Right" />

            <Fluent:StatusBarItem Title="Ptint" HorizontalAlignment="Right">
                <Fluent:Button x:Name="btnPrint" Size="Small" Icon="{iconPacks:Material Kind=MonitorScreenshot}"
                                     Click="btnPrint_Click"/>
            </Fluent:StatusBarItem>

            <Fluent:StatusBarItem Title="Zoom"
                                  HorizontalAlignment="Right"
                                  Value="{Binding Value, ElementName=zoomSlider, StringFormat={}{0:P}}" />

            <Fluent:StatusBarItem Title="Zoom Slider"
                                  HorizontalAlignment="Right">
                <Slider x:Name="zoomSlider"
                        Minimum="0.5"
                        Value="{Binding DiagramsViewModel.DiagramViewModel.ZoomValue}"
                        Maximum="2.0"
                        IsDirectionReversed="False"
                        Style="{DynamicResource ZoomSliderStyle}"
                        IsSnapToTickEnabled="True"
                        TickFrequency="0.1"
                        SmallChange="0.1"
                        LargeChange="0.1"
                        ValueChanged="ZoomSlider_OnValueChanged" />
            </Fluent:StatusBarItem>
        </Fluent:StatusBar>
    </Grid>
</Fluent:RibbonWindow>
