<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.DiagramDesigner.Additionals.Controls;assembly=AIStudio.Wpf.DiagramDesigner.Additionals"
        xmlns:views="clr-namespace:AIStudio.Wpf.DiagramApp.Views"
        xmlns:binding="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Commands;assembly=AIStudio.Wpf.DiagramDesigner.Additionals"
        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.DiagramDesigner.Additionals;assembly=AIStudio.Wpf.DiagramDesigner.Additionals"
        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.DiagramDesigner.Additionals.Converters;assembly=AIStudio.Wpf.DiagramDesigner.Additionals"
        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="600" Width="1200">
    <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"/>
            <dd:ObjectConverter x:Key="ObjectConverter"/>
            <dd:MindThemeFillBrushConverter x:Key="MindThemeFillBrushConverter"/>
            <dd:MindThemeFontBrushConverter x:Key="MindThemeFontBrushConverter"/>

            <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>
                                            <Button Margin="5" ToolTip="C#脚本"  Command="{Binding NewCommand}" CommandParameter="Script" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
                                                <Path Stretch="Uniform" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M490.666667 681.386667l17.493333 104.106666c-11.093333 5.973333-29.013333 11.52-52.906667 16.64-24.32 5.546667-52.906667 8.533333-85.76 8.533334-94.293333-1.706667-165.12-29.866667-212.48-83.626667C109.226667 672.853333 85.333333 604.16 85.333333 520.96c2.133333-98.56 30.72-174.08 85.333334-226.986667C226.986667 240.64 296.96 213.333333 381.44 213.333333c32 0 59.733333 2.986667 82.773333 8.106667s40.106667 10.666667 51.2 17.066667l-24.746666 106.24-45.226667-14.506667c-17.066667-4.266667-36.693333-6.4-59.306667-6.4-49.493333-0.426667-90.453333 15.36-122.453333 46.933333-32.426667 31.146667-49.066667 78.933333-50.346667 142.506667 0 58.026667 15.786667 103.253333 46.08 136.533333 30.293333 32.853333 72.96 49.92 127.573334 50.346667l56.746666-5.12c18.346667-3.413333 33.706667-8.106667 46.933334-13.653333M592.64 810.666667l26.026667-170.666667H554.666667l14.506666-85.333333h64l13.653334-85.333334h-64L597.333333 384h64l26.026667-170.666667h85.333333l-26.026666 170.666667h42.666666l26.026667-170.666667h85.333333l-26.026666 170.666667H938.666667l-14.506667 85.333333h-64l-13.653333 85.333334h64L896 640h-64l-26.026667 170.666667h-85.333333l26.026667-170.666667h-42.666667l-26.026667 170.666667h-85.333333m125.866667-256h42.666666l13.653334-85.333334h-42.666667l-13.653333 85.333334z" ></Path>
                                            </Button>                                           
                                        </WrapPanel>
                                    </TabItem>
                                    <TabItem Header="思维导图" >
                                        <WrapPanel Margin="5">                                           
                                            <Button Margin="5" ToolTip="思维导图"  Command="{Binding NewMindCommand}" CommandParameter="Mind" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
                                                <Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M903.526 542.788c-11.476-109.267-69.113-209.266-157.91-273.966 1.775-42.203-8.091-85.392-30.916-124.607C651.078 34.909 510.893-2.126 401.587 61.495c-75.837 44.141-116.869 125.136-113.649 207.104-69.606 50.492-123.007 124.277-147.063 213.792a391.809 391.809 0 0 0-11.196 59.809c-37.458 19.563-69.947 49.713-92.506 89.106-62.851 109.751-24.832 249.672 84.919 312.523 76.13 43.597 166.769 38.645 236.139-5.102a391.907 391.907 0 0 0 57.362 20.29c89.516 24.056 180.13 14.833 258.713-20.088 35.68 22.675 78.051 35.746 123.464 35.587 126.472-0.444 228.638-103.331 228.194-229.803-0.31-87.709-49.894-163.714-122.438-201.925zM343.497 234.956c7.264-51.226 37.068-98.744 85.254-126.791 83.531-48.619 190.659-20.317 239.278 63.214 11.79 20.256 19.044 41.901 22.096 63.762a175.057 175.057 0 0 1-2.102 60.33c-9.855 46.729-38.683 89.27-83.209 115.186-83.531 48.619-190.659 20.317-239.278-63.214-9.688-16.645-16.312-34.228-20.063-52.097a174.622 174.622 0 0 1-1.976-60.39z m9.101 640.606a174.59 174.59 0 0 1-51.354 31.888c-47.97 19.273-103.973 17.204-152.318-10.482-83.87-48.03-112.925-154.957-64.894-238.828 11.641-20.328 26.749-37.424 44.142-50.994a175.094 175.094 0 0 1 53.336-28.371c45.394-14.826 96.646-11.13 141.349 14.471 83.871 48.031 112.925 154.957 64.894 238.828-9.586 16.742-21.526 31.292-35.155 43.488z m77.009 31.305a339.803 339.803 0 0 1-24.38-7.545 229.776 229.776 0 0 0 29.388-40.412c62.851-109.751 24.832-249.672-84.919-312.523-51.188-29.314-108.937-36.677-162.371-25.063a339.779 339.779 0 0 1 5.7-24.919c18.21-67.764 55.959-125.048 105.538-167.454a229.77 229.77 0 0 0 20.304 45.656c63.621 109.306 203.806 146.341 313.112 82.72 51.001-29.685 86.26-76.04 102.911-128.148 57.693 49.633 96.988 117.799 111.025 192.597a229.761 229.761 0 0 0-49.756-5.258c-126.472 0.444-228.638 103.331-228.194 229.803 0.207 58.987 22.705 112.68 59.48 153.148-61.556 21.657-130.06 25.612-197.838 7.398z m367.972 13.649c-23.467 0.082-45.866-4.47-66.346-12.777a175.093 175.093 0 0 1-51.198-32.023c-35.495-31.897-57.89-78.104-58.07-129.584-0.34-96.649 77.735-175.274 174.384-175.614 19.296-0.068 37.87 2.998 55.249 8.705a174.572 174.572 0 0 1 53.254 28.504c40.693 31.906 66.915 81.451 67.111 137.175 0.34 96.649-77.735 175.274-174.384 175.614z" ></Path>
                                            </Button>
                                            <Button Margin="5" ToolTip="目录组织图"  Command="{Binding NewMindCommand}" CommandParameter="Directory" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
                                                <Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M438.272 951.296c-4.096-1.024-5.632-2.048-6.656-2.56-0.512-5.12-1.024-23.04 0.512-84.992l0.512-10.752H261.12c-5.632-0.512-15.36-2.56-15.36-25.088 0-2.048 0-3.584-0.512-5.632V291.328h-0.512v-24.064H69.12c-6.656 0-13.824-1.536-15.872-16.896-1.024-46.592-2.048-93.696-2.56-140.288v-20.992c0-32.768 1.024-41.472 1.536-43.52 1.024-1.536 3.584-4.608 11.776-7.168l6.656-1.536h420.352c5.12 0 10.752 2.56 16.896 7.168l1.024 0.512c0.512 0.512 1.024 2.56 1.536 6.656v199.68c0 7.168-2.56 12.8-13.824 15.36l-5.632 1.024H297.472v166.4h134.144V349.696c0-5.12 1.024-10.752 12.8-12.8H860.16c2.048 0 6.656 0 10.752 11.264v199.68c0 2.048-2.56 6.144-8.704 11.264H443.904c-5.632 0-9.728-1.536-12.288-9.728V486.4H297.472v312.832h134.656v-65.536c1.536-3.584 3.584-7.168 6.656-7.68 5.632-0.512 44.032-1.024 135.168-1.024 83.968 0 185.856 0.512 279.04 1.024 11.264 2.048 13.312 6.656 14.336 10.752 0.512 1.536 1.024 9.216 1.536 42.496v32.768c0 29.696-0.512 69.12-1.536 128-5.632 11.264-11.264 11.264-13.312 11.264H438.272z m46.08-54.272h328.192v-117.76H484.352v117.76z m0-390.144h328.192V389.12H484.352v117.76zM109.056 214.528h348.672v-117.76H109.056v117.76z" ></Path>
                                            </Button>
                                            <Button Margin="5" ToolTip="鱼骨头图"  Command="{Binding NewMindCommand}" CommandParameter="FishBone" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
                                                <Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M23.466667 674.133333c6.4-14.933333 19.2-25.6 36.266666-27.733333l292.266667-34.133333 36.266667-36.266667-98.133334-98.133333c-17.066667-17.066667-17.066667-42.666667 0-59.733334 17.066667-17.066667 42.666667-17.066667 59.733334 0l98.133333 98.133334 46.933333-46.933334-98.133333-98.133333c-17.066667-17.066667-17.066667-42.666667 0-59.733333 17.066667-17.066667 42.666667-17.066667 59.733333 0l98.133334 98.133333 44.8-44.8c-42.666667-51.2-74.666667-113.066667-93.866667-177.066667-4.266667-17.066667 2.133333-34.133333 14.933333-44.8C637.866667 51.2 791.466667 21.333333 934.4 59.733333c14.933333 4.266667 25.6 14.933333 29.866667 29.866667 38.4 142.933333 6.4 296.533333-83.2 413.866667-8.533333 10.666667-21.333333 17.066667-34.133334 17.066666-4.266667 0-8.533333 0-10.666666-2.133333-66.133333-19.2-125.866667-51.2-177.066667-93.866667L614.4 469.333333l98.133333 98.133334c17.066667 17.066667 17.066667 42.666667 0 59.733333-8.533333 8.533333-19.2 12.8-29.866666 12.8-10.666667 0-21.333333-4.266667-29.866667-12.8L554.666667 529.066667 507.733333 576l98.133334 98.133333c17.066667 17.066667 17.066667 42.666667 0 59.733334-8.533333 8.533333-19.2 12.8-29.866667 12.8-10.666667 0-21.333333-4.266667-29.866667-12.8L448 635.733333l-36.266667 36.266667-34.133333 292.266667c-2.133333 17.066667-12.8 29.866667-27.733333 36.266666-4.266667 2.133333-10.666667 2.133333-14.933334 2.133334-10.666667 0-21.333333-4.266667-29.866666-12.8L34.133333 718.933333c-12.8-12.8-14.933333-29.866667-10.666666-44.8z m298.666666 27.733334l-164.266666 19.2 147.2 147.2 17.066666-166.4zM597.333333 192c19.2 53.333333 51.2 102.4 89.6 142.933333 40.533333 40.533333 89.6 70.4 142.933334 89.6 55.466667-85.333333 76.8-189.866667 55.466666-292.266666C787.2 115.2 682.666667 136.533333 597.333333 192z" ></Path>
                                            </Button>
                                            <Button Margin="5" ToolTip="逻辑结构图"  Command="{Binding NewMindCommand}" CommandParameter="Logical" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
                                                <Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M768 128a128 128 0 1 1 0 256h-128a128 128 0 0 1-120.704-85.333333H469.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333v7.296a128 128 0 0 1 0 241.408V640c0 46.933333 38.4 85.333333 85.333333 85.333333h49.92A128.128 128.128 0 0 1 640 640h128a128 128 0 1 1 0 256h-128a128 128 0 0 1-120.704-85.333333H469.333333c-94.293333 0-170.666667-76.373333-170.666666-170.666667H213.333333a128 128 0 1 1 0-256h85.333334c0-94.293333 76.373333-170.666667 170.666666-170.666667h49.92A128.128 128.128 0 0 1 640 128h128z m0 597.333333h-128a42.666667 42.666667 0 0 0 0 85.333334h128a42.666667 42.666667 0 0 0 0-85.333334zM341.333333 469.333333H213.333333a42.666667 42.666667 0 0 0 0 85.333334h128a42.666667 42.666667 0 0 0 0-85.333334z m426.666667-256h-128a42.666667 42.666667 0 0 0 0 85.333334h128a42.666667 42.666667 0 0 0 0-85.333334z" ></Path>
                                            </Button>
                                            <Button Margin="5" ToolTip="组织结构图"  Command="{Binding NewMindCommand}" CommandParameter="Organizational" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
                                                <Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M1063.331536 747.989218h-69.002695V511.309973a34.501348 34.501348 0 0 0-34.501348-34.501348H581.692722V276.010782h69.002696a34.501348 34.501348 0 0 0 34.501347-34.501348v-207.008086a34.501348 34.501348 0 0 0-34.501347-34.501348h-207.008086A34.501348 34.501348 0 0 0 414.016173 34.501348v207.008086a34.501348 34.501348 0 0 0 34.501347 34.501348h69.002696v200.797843H138.005391a34.501348 34.501348 0 0 0-34.501348 34.501348v236.679245h-69.002695a34.501348 34.501348 0 0 0-34.501348 34.501348v207.008086a34.501348 34.501348 0 0 0 34.501348 34.501348h207.008086a34.501348 34.501348 0 0 0 34.501348-34.501348v-207.008086a34.501348 34.501348 0 0 0-34.501348-34.501348h-69.002695V545.811321h345.013477v202.177897h-69.002696a34.501348 34.501348 0 0 0-34.501347 34.501348v207.008086a34.501348 34.501348 0 0 0 34.501347 34.501348h207.008086a34.501348 34.501348 0 0 0 34.501348-34.501348v-207.008086a34.501348 34.501348 0 0 0-34.501348-34.501348h-69.002695V545.811321h345.013477v202.177897h-69.002695a34.501348 34.501348 0 0 0-34.501348 34.501348v207.008086a34.501348 34.501348 0 0 0 34.501348 34.501348h207.008086a34.501348 34.501348 0 0 0 34.501348-34.501348v-207.008086a34.501348 34.501348 0 0 0-40.711591-34.501348zM483.018868 69.002695h138.005391v138.005391H483.018868zM207.008086 954.997305H69.002695v-138.005391h138.005391z m414.016173 0H483.018868v-138.005391h138.005391z m414.016172 0h-138.005391v-138.005391h138.005391z" ></Path>
                                            </Button>
                                            <Button Margin="5" ToolTip="天盘图"  Command="{Binding NewMindCommand}" IsEnabled="False" CommandParameter="Celestial" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
                                                <Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M832 368c42.666667-98.346667 46.08-183.466667 0-228.693333A125.226667 125.226667 0 0 0 740.906667 106.666667c-65.28 0-149.333333 31.146667-236.8 86.826666A341.333333 341.333333 0 0 0 193.493333 503.466667C105.173333 642.346667 79.146667 772.48 139.306667 832a125.226667 125.226667 0 0 0 91.733333 32.64A356.693333 356.693333 0 0 0 368.213333 832 341.333333 341.333333 0 0 0 832 368zM740.906667 192a47.786667 47.786667 0 0 1 31.36 7.68c10.666667 10.453333 11.733333 42.666667-1.706667 88.533333A341.333333 341.333333 0 0 0 650.666667 213.333333a260.906667 260.906667 0 0 1 90.24-21.333333zM533.333333 277.333333a256 256 0 0 1 200.746667 97.706667 861.44 861.44 0 0 1-154.666667 204.373333 874.666667 874.666667 0 0 1-204.586666 154.666667A256 256 0 0 1 533.333333 277.333333zM199.68 772.266667c-13.013333-12.8-11.306667-58.026667 13.44-121.386667a344.32 344.32 0 0 0 74.88 119.466667 208.426667 208.426667 0 0 1-56.96 9.6 47.786667 47.786667 0 0 1-31.36-7.68zM533.333333 789.333333a252.586667 252.586667 0 0 1-67.626666-9.386666A997.973333 997.973333 0 0 0 640 640a1005.866667 1005.866667 0 0 0 140.373333-173.866667A252.586667 252.586667 0 0 1 789.333333 533.333333a256 256 0 0 1-256 256z" ></Path>
                                            </Button>
                                        </WrapPanel>
                                    </TabItem>                            
                                </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 PageViewModel.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 PageViewModel.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 LineDrawModeSelected}" Icon="{iconPacks:Material Kind=VectorPolyline}" Width="50" VerticalAlignment="Top">
                        <Fluent:MenuItem Header="曲线连接线" Size="Middle" IsCheckable="True" IsChecked="{Binding LineDrawMode,Converter={dd:ConverterValueMapToBool Parameter='ConnectingLineSmooth'}, ConverterParameter='ConnectingLineSmooth'}" Icon="{iconPacks:Material Kind=VectorRadius}"/>
                        <Fluent:MenuItem Header="直线连接线" Size="Middle" IsCheckable="True" IsChecked="{Binding LineDrawMode,Converter={dd:ConverterValueMapToBool Parameter='ConnectingLineStraight'}, ConverterParameter='ConnectingLineStraight'}" Icon="{iconPacks:Material Kind=VectorLine}"/>
                        <Fluent:MenuItem Header="折线连接线" Size="Middle" IsCheckable="True" IsChecked="{Binding LineDrawMode,Converter={dd:ConverterValueMapToBool Parameter='ConnectingLineCorner'}, ConverterParameter='ConnectingLineCorner'}" Icon="{iconPacks:Material Kind=VectorPolyline}"/>
                        <Fluent:MenuItem Header="边界连接线" Size="Middle" IsCheckable="True" IsChecked="{Binding LineDrawMode,Converter={dd:ConverterValueMapToBool Parameter='ConnectingLineBoundary'}, ConverterParameter='ConnectingLineBoundary'}" Icon="{iconPacks:Material Kind=VectorPolylineEdit}"/>
                        <Fluent:MenuItem Header="自动连接" Size="Middle" IsCheckable="True" IsChecked="{Binding EnableSnapping}" Icon="{iconPacks:Material Kind=TransitConnectionHorizontal}"/>
                        <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 LineDrawMode}" Value="ConnectingLineSmooth">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="VectorRadius" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding LineDrawMode}" Value="ConnectingLineStraight">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="VectorLine" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding LineDrawMode}" Value="ConnectingLineCorner">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="VectorPolyline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding LineDrawMode}" Value="ConnectingLineBoundary">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="VectorPolylineEdit" 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="RouterMode" IsCheckable="False" IsChecked="{Binding LineRouterModeSelected}" Icon="{iconPacks:FontAwesome Kind=WindowMinimizeRegular}" Width="50" VerticalAlignment="Top">
                        <Fluent:MenuItem Header="普通" Size="Middle" IsCheckable="True" IsChecked="{Binding LineRouterMode,Converter={dd:ConverterValueMapToBool Parameter='RouterNormal'}, ConverterParameter='RouterNormal'}" Icon="{iconPacks:FontAwesome Kind=WindowMinimizeRegular}"/>
                        <Fluent:MenuItem Header="正交" Size="Middle" IsCheckable="True" IsChecked="{Binding LineRouterMode,Converter={dd:ConverterValueMapToBool Parameter='RouterOrthogonal'}, ConverterParameter='RouterOrthogonal'}" Icon="{iconPacks:FontAwesome Kind=BorderStyleSolid}"/>
                        <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 LineRouterMode}" Value="RouterNormal">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconFontAwesome Kind="WindowMinimizeRegular" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding LineRouterMode}" Value="RouterOrthogonal">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconFontAwesome Kind="BorderStyleSolid" 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 DrawingDrawModeSelected}"  Width="50" VerticalAlignment="Top">
                        <Fluent:MenuItem Header="橡皮檫" Size="Middle" IsCheckable="True" IsChecked="{Binding DrawingDrawMode,Converter={dd:ConverterValueMapToBool Parameter='Eraser'}, ConverterParameter='Eraser'}" Icon="{iconPacks:Material Kind=Eraser}" />
                        <Fluent:MenuItem Header="矩形工具" Size="Middle" IsCheckable="True" IsChecked="{Binding DrawingDrawMode,Converter={dd:ConverterValueMapToBool Parameter='Rectangle'}, ConverterParameter='Rectangle'}" Icon="{iconPacks:Material Kind=RectangleOutline}" />
                        <Fluent:MenuItem Header="椭圆工具" Size="Middle" IsCheckable="True" IsChecked="{Binding DrawingDrawMode,Converter={dd:ConverterValueMapToBool Parameter='Ellipse'}, ConverterParameter='Ellipse'}" Icon="{iconPacks:Material Kind=EllipseOutline}" />
                        <Fluent:MenuItem Header="线条工具" Size="Middle" IsCheckable="True" IsChecked="{Binding DrawingDrawMode,Converter={dd:ConverterValueMapToBool Parameter='Line'}, ConverterParameter='Line'}" Icon="{iconPacks:Material Kind=Minus}" />
                        <Fluent:MenuItem Header="铅笔工具" Size="Middle" IsCheckable="True" IsChecked="{Binding DrawingDrawMode,Converter={dd:ConverterValueMapToBool Parameter='Polyline'}, ConverterParameter='Polyline'}" Icon="{iconPacks:Material Kind=Pencil}" />
                        <Fluent:MenuItem Header="闭合铅笔" Size="Middle" IsCheckable="True" IsChecked="{Binding DrawingDrawMode,Converter={dd:ConverterValueMapToBool Parameter='Polygon'}, ConverterParameter='Polygon'}" Icon="{iconPacks:Material Kind=Pencil}" />
                        <Fluent:MenuItem Header="钢笔工具" Size="Middle" IsCheckable="True" IsChecked="{Binding DrawingDrawMode,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 DrawingDrawMode}" Value="Eraser">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="Eraser" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DrawingDrawMode}" Value="Line">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="Minus" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DrawingDrawMode}" Value="Rectangle">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="RectangleOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DrawingDrawMode}" Value="Ellipse">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="EllipseOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DrawingDrawMode}" Value="Polyline">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="Pencil" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DrawingDrawMode}" Value="Polygon">
                                        <Setter Property="LargeIcon">
                                            <Setter.Value>
                                                <iconPacks:PackIconMaterial Kind="Pencil" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding DrawingDrawMode}" 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 SelectedItemViewModel,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 PageViewModel.DiagramViewModel.BringToFrontCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/BringToFront.png"/>
                        <Fluent:Button Margin="5" Header="置于底层" Command="{Binding PageViewModel.DiagramViewModel.SendToBackCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/SendToBack.png"/>
                        <Fluent:Button Margin="5" Header="上移一层" Command="{Binding PageViewModel.DiagramViewModel.BringForwardCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/BringForward.png"/>
                        <Fluent:Button Margin="5" Header="下移一层" Command="{Binding PageViewModel.DiagramViewModel.SendBackwardCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/SendBackward.png"/>
                    </Fluent:DropDownButton>
                    <Fluent:SplitButton Header="组合" Icon="{iconPacks:Material Kind=Group}" Width="50" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.GroupCommand}">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="Group" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:Button Margin="5" Header="组合" Command="{Binding PageViewModel.DiagramViewModel.GroupCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/BringForward.png"/>
                        <Fluent:Button Margin="5" Header="取消组合" Command="{Binding PageViewModel.DiagramViewModel.UngroupCommand}" Size="Middle" Icon="/AIStudio.Wpf.DiagramApp;component/Images/SendBackward.png"/>
                    </Fluent:SplitButton>
                    <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 PageViewModel.DiagramViewModel.AlignLeftCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/AlignObjectsLeft.png"/>
                            <Fluent:Button Margin="5" Command="{Binding PageViewModel.DiagramViewModel.AlignHorizontalCentersCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/AlignObjectsCenteredHorizontal.png"/>
                            <Fluent:Button Margin="5" Command="{Binding PageViewModel.DiagramViewModel.AlignRightCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/AlignObjectsRight.png"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Fluent:Button Margin="5" Command="{Binding PageViewModel.DiagramViewModel.AlignTopCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/AlignObjectsTop.png"/>
                            <Fluent:Button Margin="5" Command="{Binding PageViewModel.DiagramViewModel.AlignVerticalCentersCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/AlignObjectsCenteredVertical.png"/>
                            <Fluent:Button Margin="5" Command="{Binding PageViewModel.DiagramViewModel.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 PageViewModel.DiagramViewModel.DistributeHorizontalCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/DistributeObjectsHorizontal.png"/>
                            <Fluent:Button Margin="5" Command="{Binding PageViewModel.DiagramViewModel.DistributeVerticalCommand}" Size="Small" Icon="/AIStudio.Wpf.DiagramApp;component/Images/DistributeObjectsVertical.png"/>
                        </StackPanel>
                    </Fluent:DropDownButton>
                    <Fluent:SplitButton Header="翻转" Icon="{iconPacks:VaadinIcons Kind=FlipH}" Width="50" VerticalAlignment="Top"  IsCheckable="True" IsChecked="{Binding SelectedItemViewModel.ShowRotate}">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconVaadinIcons Kind="FlipH" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Margin="5" Text="镜像" VerticalAlignment="Center"/>
                            <Fluent:ToggleButton IsChecked="{Binding SelectedItemViewModel.ScaleX,Converter={dd:ConverterValueMapToBool Parameter='1'}, ConverterParameter='-1'}" 
                                                 Margin="5" Size="Small" Icon="{iconPacks:Material Kind=FlipHorizontal}"/>
                            <Fluent:ToggleButton IsChecked="{Binding SelectedItemViewModel.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 SelectedItemViewModel.Angle,Mode=TwoWay}"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding SelectedItemViewModel.Angle,Mode=TwoWay}" Maximum="359" Minimum="0"
                                    Format="0 deg" />
                        </StackPanel>
                    </Fluent:SplitButton>
                    <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 SelectedItemViewModel.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 SelectedItemViewModel.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 SelectedItemViewModel.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 SelectedItemViewModel.Top,Mode=TwoWay}" Minimum="0"
                                    Format="0" />
                        </StackPanel>
                        <Separator />
                        <TextBlock Margin="5" Text="等大小"/>
                        <UniformGrid Rows="1">
                            <Fluent:Button Margin="5" ToolTip="等宽" Command="{Binding PageViewModel.DiagramViewModel.SameWidthCommand}" Size="Small" Icon="{iconPacks:FontAwesome Kind=ArrowsAltHSolid}"/>
                            <Fluent:Button Margin="5" ToolTip="等高" Command="{Binding PageViewModel.DiagramViewModel.SameHeightCommand}" Size="Small" Icon="{iconPacks:FontAwesome Kind=ArrowsAltVSolid}"/>
                            <Fluent:Button Margin="5" ToolTip="等大小" Command="{Binding PageViewModel.DiagramViewModel.SameSizeCommand}" Size="Small" Icon="{iconPacks:FontAwesome Kind=ArrowsAltSolid}"/>
                            <Fluent:Button Margin="5" ToolTip="等角度" Command="{Binding PageViewModel.DiagramViewModel.SameAngleCommand}" 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" dd:EnumHelper.Enum="{x:Type dd:PathStyle}" SelectedItem="{Binding ShapeViewModel.SourceMarker.PathStyle}">
                                        <Fluent:ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <DockPanel>
                                                    <Grid>
                                                        <Line X1="0" Y1="0" X2="100" Y2="0" Stroke="Black" Margin="5,0,0,0" 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="180" />
                                                            </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" dd:EnumHelper.Enum="{x:Type dd:PathStyle}" SelectedItem="{Binding ShapeViewModel.SinkMarker.PathStyle}">
                                        <Fluent:ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <DockPanel>
                                                    <Grid>
                                                        <Line X1="0" Y1="0" X2="100" Y2="0" Stroke="Black" Margin="0,0,5,0" 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>
                                                    </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" dd:EnumHelper.Enum="{x:Type dd:SizeStyle}" SelectedItem="{Binding ShapeViewModel.SourceMarker.SizeStyle}">
                                        <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" dd:EnumHelper.Enum="{x:Type dd:SizeStyle}" SelectedItem="{Binding ShapeViewModel.SinkMarker.SizeStyle}">
                                        <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" dd: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>
                                <TextBlock Text="线条动画" Margin="5"/>
                                <Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:LineAnimation}" SelectedItem="{Binding AnimationViewModel.Animation}">
                                    <Fluent:ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
                                        </DataTemplate>
                                    </Fluent:ComboBox.ItemTemplate>
                                </Fluent:ComboBox>
                            </StackPanel>
                            <StackPanel>
                                <TextBlock Text="动画样式" Margin="5"/>
                                <StackPanel Orientation="Horizontal">
                                    <Fluent:ComboBox Size="Small" Width="60" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:PathStyle}" SelectedItem="{Binding AnimationViewModel.AnimationPath.PathStyle}">
                                        <Fluent:ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <DockPanel>
                                                    <Grid>                                                       
                                                        <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="180" />
                                                            </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="70" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:SizeStyle}" SelectedItem="{Binding AnimationViewModel.AnimationPath.SizeStyle}">
                                        <Fluent:ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
                                            </DataTemplate>
                                        </Fluent:ComboBox.ItemTemplate>
                                    </Fluent:ComboBox>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                        <Fluent:DropDownButton.ToolTip>
                            <Fluent:ScreenTip Title="LineStyle"
                                              Text="线条样式"
                                              Width="190" />
                        </Fluent:DropDownButton.ToolTip>
                    </Fluent:DropDownButton>

                    <Fluent:SplitButton IsCheckable="True" Icon="{iconPacks:Material Kind=Lock}" 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 PageViewModel.DiagramViewModel.CenterMoveCommand}" >
                        <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,Delay=100}"
                                            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:RibbonTabItem>
            <Fluent:RibbonTabItem Header="插入">
                <Fluent:RibbonGroupBox Header="插入"
                                       IsLauncherVisible="True">
                    <Fluent:SplitButton Header="空白页" Width="50" VerticalAlignment="Top" Command="{Binding PageViewModel.AddPageCommand}">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="FileOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:MenuItem Header="空白页" Size="Middle" Command="{Binding PageViewModel.AddPageCommand}" Icon="{iconPacks:Material Kind=FileOutline}"/>
                        <Fluent:MenuItem Header="复制本页" Size="Middle" Command="{Binding PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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" dd:EnumHelper.Enum="{x:Type dd:PageSizeType}" SelectedItem="{Binding PageViewModel.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" dd:EnumHelper.Enum="{x:Type dd:PageSizeOrientation}" SelectedItem="{Binding PageViewModel.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" dd:EnumHelper.Enum="{x:Type dd:PageUnit}" SelectedItem="{Binding PageViewModel.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 PageViewModel.ShowGrid}" >
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="Grid" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Margin="5" Text="宽度(mm)" VerticalAlignment="Center"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding PageViewModel.DiagramViewModel.PhysicalGridCellWidth,Mode=TwoWay}" Minimum="0" Format="0" />
                            <TextBlock Margin="5" Text="高度(mm)" VerticalAlignment="Center"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding PageViewModel.DiagramViewModel.PhysicalGridCellHeight,Mode=TwoWay}" Minimum="0" Format="0" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Margin="5" Text="左右边距(mm)" VerticalAlignment="Center"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding PageViewModel.DiagramViewModel.PhysicalGridMarginWidth,Mode=TwoWay}" Minimum="0" Format="0" />
                            <TextBlock Margin="5" Text="上下边距(mm)" VerticalAlignment="Center"/>
                            <Fluent:Spinner Margin="5" Width="60" Size="Small" Value="{Binding PageViewModel.DiagramViewModel.PhysicalGridMarginHeight,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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.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="思维导图" Visibility="{Binding PageViewModel.DiagramType,Converter={dd:ConverterValueMapSetToVisibility},ConverterParameter='Mind'}">
                <Fluent:RibbonGroupBox Header="思路" IsLauncherVisible="True">
                    <Fluent:Button Header="插入下级主题" SizeDefinition="Middle" Width="110" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.AddChildCommand}">
                        <Fluent:Button.Icon>
                            <Path Width="15" Height="15" Stretch="Uniform" Fill="Black" Data="M992.9 500.1H355c-19.3 0-35 15.7-35 35V660H182V340.8h427.8c32 0 58-26 58-58V58c0-32-25.9-58-58-58H58C26 0 0 26 0 58v224.8c0 32 26 58 58 58h54V689c0 13.3 7.4 24.8 18.2 30.7 6.3 6.3 15.1 10.3 24.8 10.3h165v145.9c0 19.3 15.7 35 35 35h226c19.3 0 35-15.7 35-35s-15.7-35-35-35H390V570.1h567.9V611c0 19.3 15.7 35 35 35s35-15.7 35-35v-75.9c0-19.3-15.7-35-35-35zM70 70h527.8v200.8H70V70zM989 830h-89v-89c0-19.3-15.7-35-35-35s-35 15.7-35 35v89h-89c-19.3 0-35 15.7-35 35s15.7 35 35 35h89v89c0 19.3 15.7 35 35 35s35-15.7 35-35v-89h89c19.3 0 35-15.7 35-35s-15.7-35-35-35z"></Path>
                        </Fluent:Button.Icon>
                    </Fluent:Button>
                    <Fluent:Button Header="插入同级主题" SizeDefinition="Middle" Width="110" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.AddPearCommand}">
                        <Fluent:Button.Icon>
                            <Path Width="15" Height="15" Stretch="Uniform" Fill="Black" Data="M651.8 775.5h-20.3v-527h178V305c0 19.3 15.7 35 35 35s35-15.7 35-35v-91.5c0-19.3-15.7-35-35-35h-248c-19.3 0-35 15.7-35 35V477H340.8V236.1c0-32-26-58-58-58H58c-32 0-58 26-58 58v551.8c0 32 26 58 58 58h224.8c32 0 58-26 58-58V547h220.7v263.5c0 19.3 15.7 35 35 35h55.3c19.3 0 35-15.7 35-35s-15.7-35-35-35z m-381 0.4H70V248.1h200.8v527.8zM990 651.5h-89v-89c0-19.3-15.7-35-35-35s-35 15.7-35 35v89h-89c-19.3 0-35 15.7-35 35s15.7 35 35 35h89v89c0 19.3 15.7 35 35 35s35-15.7 35-35v-89h89c19.3 0 35-15.7 35-35s-15.7-35-35-35z"></Path>
                        </Fluent:Button.Icon>
                    </Fluent:Button>
                    <Fluent:Button Header="插入上级主题" SizeDefinition="Middle" Width="110" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.AddParentCommand}">
                        <Fluent:Button.Icon>
                            <Path Width="15" Height="15" Stretch="Uniform" Fill="Black" Data="M992.9 500.1H355c-19.3 0-35 15.7-35 35V660H182V340.8h427.8c32 0 58-26 58-58V58c0-32-25.9-58-58-58H58C26 0 0 26 0 58v224.8c0 32 26 58 58 58h54V689c0 13.3 7.4 24.8 18.2 30.7 6.3 6.3 15.1 10.3 24.8 10.3h165v145.9c0 19.3 15.7 35 35 35h226c19.3 0 35-15.7 35-35s-15.7-35-35-35H390V570.1h567.9V611c0 19.3 15.7 35 35 35s35-15.7 35-35v-75.9c0-19.3-15.7-35-35-35zM70 70h527.8v200.8H70V70zM989 830h-89v-89c0-19.3-15.7-35-35-35s-35 15.7-35 35v89h-89c-19.3 0-35 15.7-35 35s15.7 35 35 35h89v89c0 19.3 15.7 35 35 35s35-15.7 35-35v-89h89c19.3 0 35-15.7 35-35s-15.7-35-35-35z"></Path>
                        </Fluent:Button.Icon>
                    </Fluent:Button>
                    <Fluent:Button Header="新建根主题" Width="70" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.AddRootCommand}">
                        <Fluent:Button.LargeIcon>
                            <Path Width="15" Height="15" Stretch="Uniform" Fill="Black" Data="M696 334.2H326.6c-27.4 0-49.7-22.3-49.7-49.7V114c0-27.4 22.3-49.7 49.7-49.7H696c27.4 0 49.7 22.3 49.7 49.7v170.5c0.1 27.4-22.2 49.7-49.7 49.7zM326.6 106.8c-3.9 0-7.1 3.3-7.1 7.1v170.5c0 3.9 3.3 7.1 7.1 7.1H696c3.9 0 7.1-3.3 7.1-7.1V114c0-3.9-3.3-7.1-7.1-7.1H326.6zM895 960.8H127.7c-27.4 0-49.7-22.3-49.7-49.7V541.6c0-27.4 22.3-49.7 49.7-49.7H895c27.4 0 49.7 22.3 49.7 49.7V911c0 27.5-22.3 49.8-49.7 49.8zM127.7 534.5c-3.9 0-7.1 3.3-7.1 7.1V911c0 3.9 3.3 7.1 7.1 7.1H895c3.9 0 7.1-3.3 7.1-7.1V541.6c0-3.9-3.3-7.1-7.1-7.1H127.7zM511.4 533.1c-11.8 0-21.3-9.5-21.3-21.3l-0.1-198.9c0-11.8 9.5-21.3 21.3-21.3s21.3 9.5 21.3 21.3l0.1 198.9c0 11.8-9.5 21.3-21.3 21.3z"></Path>
                        </Fluent:Button.LargeIcon>
                    </Fluent:Button>
                    <Fluent:Button Header="上移" SizeDefinition="Middle" Width="60" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.MoveForwardCommand}">
                        <Fluent:Button.Icon>
                            <Path Width="15" Height="15" Stretch="Uniform" Fill="Black" Data="M62.5 500L312.5 500L312.5 937.5L687.5 937.5L687.5 500L937.5 500L500 62.5Z"></Path>
                        </Fluent:Button.Icon>
                    </Fluent:Button>
                    <Fluent:Button Header="下移" SizeDefinition="Middle" Width="60" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.MoveBackCommand}">
                        <Fluent:Button.Icon>
                            <Path Width="15" Height="15" Stretch="Uniform" Fill="Black" Data="M687.5 62.5L312.5 62.5L312.5 500L62.5 500L500 937.5L937.4 500L687.5 500Z"></Path>
                        </Fluent:Button.Icon>
                    </Fluent:Button>
                    <Fluent:Button Header="编辑" SizeDefinition="Middle" Width="60" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.EditCommand}">
                        <Fluent:Button.Icon>
                            <Path Width="15" Height="15" Stretch="Uniform" Fill="Black" Data="M8,12H16V14H8V12M10,20H6V4H13V9H18V12.1L20,10.1V8L14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H10V20M8,18H12.1L13,17.1V16H8V18M20.2,13C20.3,13 20.5,13.1 20.6,13.2L21.9,14.5C22.1,14.7 22.1,15.1 21.9,15.3L20.9,16.3L18.8,14.2L19.8,13.2C19.9,13.1 20,13 20.2,13M20.2,16.9L14.1,23H12V20.9L18.1,14.8L20.2,16.9Z"></Path>
                        </Fluent:Button.Icon>
                    </Fluent:Button>
                    <Fluent:SplitButton Header="链接" GroupName="Link" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconModern Kind="Link" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="链接地址："></TextBlock>
                            <TextBox x:Name="link" Width="300" Height="50" Text="{Binding PageViewModel.DiagramViewModel.SelectedItem.LinkInfo.Link}"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="提示文本："></TextBlock>
                            <TextBox x:Name="linktext" Width="300" Height="50" Text="{Binding PageViewModel.DiagramViewModel.SelectedItem.LinkInfo.Text}"/>
                        </StackPanel>
                        <Fluent:MenuItem Header="插入链接" Command="{Binding PageViewModel.DiagramViewModel.AddLinkCommand}">
                            <MenuItem.CommandParameter>
                                <MultiBinding Converter="{StaticResource ObjectConverter}">
                                    <Binding ElementName="link" Path="Text"></Binding>
                                    <Binding ElementName="linktext" Path="Text"></Binding>
                                </MultiBinding>
                            </MenuItem.CommandParameter>
                        </Fluent:MenuItem>
                        <Fluent:MenuItem Header="移除已有链接" Command="{Binding PageViewModel.DiagramViewModel.RemoveLinkCommand}"></Fluent:MenuItem>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Link"
                                              Text="添加链接"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="图片" GroupName="Image" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconRemixIcon Kind="Image2Line" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="文件地址："></TextBlock>
                            <TextBox x:Name="imageurl" Width="300" Height="50" Text="{Binding PageViewModel.DiagramViewModel.ImageInfo.Url}"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="提示文本："></TextBlock>
                            <TextBox x:Name="imagetext" Width="300" Height="50" Text="{Binding PageViewModel.DiagramViewModel.ImageInfo.Text}"/>
                        </StackPanel>
                        <Fluent:MenuItem Header="插入图片" Command="{Binding PageViewModel.DiagramViewModel.AddImageCommand}">
                            <MenuItem.CommandParameter>
                                <MultiBinding Converter="{StaticResource ObjectConverter}">
                                    <Binding ElementName="imageurl" Path="Text"></Binding>
                                    <Binding ElementName="imagetext" Path="Text"></Binding>
                                </MultiBinding>
                            </MenuItem.CommandParameter>
                        </Fluent:MenuItem>
                        <Fluent:MenuItem Header="移除已有图片" Command="{Binding PageViewModel.DiagramViewModel.RemoveImageCommand}"></Fluent:MenuItem>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Image"
                                              Text="添加图片"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="备注" GroupName="Remark" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="TextBoxOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <TextBox x:Name="remark" Width="300" Height="50" Text="{Binding PageViewModel.DiagramViewModel.Remark}"/>
                        <Fluent:MenuItem Header="插入备注" Command="{Binding PageViewModel.DiagramViewModel.AddRemarkCommand}" CommandParameter="{Binding ElementName=remark,Path=Text}"></Fluent:MenuItem>
                        <Fluent:MenuItem Header="移除已有备注" Command="{Binding PageViewModel.DiagramViewModel.RemoveRemarkCommand}"></Fluent:MenuItem>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Image"
                                              Text="添加备注"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <UniformGrid Columns="5" VerticalAlignment="Top" Margin="0,8,0,0" >
                        <Button Style="{StaticResource FlatButtonStyle}"                 
                                Background="#FFC5BDAE" 
                                Width="20"
                                Height="20"        
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddPriorityCommand}"
                                CommandParameter="Null">
                            <Path Stretch="Uniform" Fill="DarkRed" Data="M966.4 761.6l-140.8 140.8-313.6-320-313.6 320-140.8-140.8 320-313.6-320-313.6 140.8-140.8 313.6 320 313.6-320 140.8 140.8-320 313.6z"></Path>
                        </Button>

                        <Button Style="{StaticResource FlatButtonStyle}"                 
                                Background="Red" 
                                Width="20"
                                Height="20"   
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddPriorityCommand}"
                                CommandParameter="1">
                            <Path Stretch="Uniform" Fill="White" RenderTransformOrigin="0.5,0.5" Data="M700 1125V100H600V1014.8L375 954.5V1058.05L625 1125z">
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Button>

                        <Button Style="{StaticResource FlatButtonStyle}"                 
                                Background="Blue" 
                                Width="20"
                                Height="20"   
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddPriorityCommand}"
                                CommandParameter="2">
                            <Path Stretch="Uniform" Fill="White" RenderTransformOrigin="0.5,0.5" Data="M800 825A200 200 0 1 1 400 825H300A300 300 0 1 0 833.15 636.2L467.15 200.0499999999999L900 200V100H300V156.3499999999999L753.2 696.4499999999999A199.10000000000002 199.10000000000002 0 0 1 800 825z">
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Button>

                        <Button Style="{StaticResource FlatButtonStyle}"                 
                                Background="Green" 
                                Width="20"
                                Height="20"    
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddPriorityCommand}"
                                CommandParameter="3">
                            <Path Stretch="Uniform" Fill="White" RenderTransformOrigin="0.5,0.5" Data="M900 1100V1031.9L640.4499999999999 722.5A325.05 325.05 0 1 0 284.65 321.0999999999999L381.65 345.3999999999999A225.1 225.1 0 0 1 825 400A225 225 0 0 1 499.7500000000001 601.5L488.3500000000001 595.4000000000001L453.8500000000001 655.7500000000001L742.75 1000L325 1000V1100H900z">
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Button>

                        <Button Style="{StaticResource FlatButtonStyle}"                 
                                Background="Orange" 
                                Width="20"
                                Height="20"   
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddPriorityCommand}"
                                CommandParameter="4">
                            <Path Stretch="Uniform" Fill="White" RenderTransformOrigin="0.5,0.5" Data="M800 1125V400H950V300H800V100H700V300H200V355.1L700 1125H800zM700 400V941.45L348.4 400H700z">
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Button>

                        <Button Style="{StaticResource FlatButtonStyle}"                 
                                Background="Purple" 
                                Width="20"
                                Height="20"   
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddPriorityCommand}"
                                CommandParameter="5">
                            <Path Stretch="Uniform" Fill="White" RenderTransformOrigin="0.5,0.5" Data="M900 1100V1000H465.0000000000001L431.1500000000001 677.75A325 325 0 1 0 284.6500000000001 321.1L381.6500000000001 345.4000000000001A225.1 225.1 0 0 1 825 400A225 225 0 0 1 600 625C498.9 625 436.1 593.0500000000001 402 548.5L323.25 607.6L375 1100H900z">
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Button>

                        <Button Style="{StaticResource FlatButtonStyle}"                 
                                Background="Gray" 
                                Width="20"
                                Height="20"  
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddPriorityCommand}"
                                CommandParameter="6">
                            <Path Stretch="Uniform" Fill="White" RenderTransformOrigin="0.5,0.5" Data="M744.3 1100L522.4 715.7A325 325 0 1 0 320 565L628.8000000000001 1100H744.3000000000001zM600 625A225 225 0 1 1 600 175A225 225 0 0 1 600 625z">
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Button>
                        <Button Style="{StaticResource FlatButtonStyle}"                 
                                Background="Gray" 
                                Width="20"
                                Height="20"   
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddPriorityCommand}"
                                CommandParameter="7">
                            <Path Stretch="Uniform" Fill="White" RenderTransformOrigin="0.5,0.5" Data="M950 1100V1025L538.15 100H428.7L829.35 1000H300V1100z">
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Button>
                        <Button Style="{StaticResource FlatButtonStyle}"                 
                                Background="Gray" 
                                Width="20"
                                Height="20"   
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddPriorityCommand}"
                                CommandParameter="8">
                            <Path Stretch="Uniform" Fill="White" RenderTransformOrigin="0.5,0.5" Data="M600 1125A275 275 0 0 0 767.6 632C861.9999999999999 579.5 925 484 925 375C925 209.3 779.5 75 600 75S275 209.3 275 375C275 484.0500000000001 338.05 579.5 432.35 632.05A275 275 0 0 0 600 1125zM600 575C474 575 375 483.6 375 375C375 266.4 474 175 600 175S825 266.4 825 375C825 483.6 726 575 600 575zM600 1025A175 175 0 1 1 600 675A175 175 0 0 1 600 1025z">
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Button>
                        <Button Style="{StaticResource FlatButtonStyle}"                 
                                Background="Gray" 
                                Width="20"
                                Height="20" 
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddPriorityCommand}"
                                CommandParameter="9">
                            <Path Stretch="Uniform" Fill="White" RenderTransformOrigin="0.5,0.5" Data="M600 1125A325 325 0 0 0 880.95 636.5L571.15 100.05H455.7L677.6500000000001 484.35A325 325 0 1 0 600 1125zM600 1025A225 225 0 1 1 600 575A225 225 0 0 1 600 1025z">
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Button>
                    </UniformGrid>
                    <UniformGrid Columns="5" VerticalAlignment="Top" Margin="0,8,0,0">
                        <Button Style="{StaticResource FlatCircleButtonStyle}" 
                                Height="20" 
                                Width="20"
                                Background="Yellow"
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddRatioCommand}"
                                CommandParameter="Null">
                            <Path  Stretch="Uniform" Fill="DarkRed" Data="m 256,76 c 48.1,0 93.3,18.7 127.3,52.7 34,34 52.7,79.2 52.7,127.3 0,48.1 -18.7,93.3 -52.7,127.3 -34,34 -79.2,52.7 -127.3,52.7 -48.1,0 -93.3,-18.7 -127.3,-52.7 C 94.7,349.3 76,304.1 76,256 76,207.9 94.7,162.7 128.7,128.7 162.7,94.7 207.9,76 256,76 m 0,-28 C 141.1,48 48,141.1 48,256 48,370.9 141.1,464 256,464 370.9,464 464,370.9 464,256 464,141.1 370.9,48 256,48 Z m 75.3,260.7 -52.7,-52.7 52.7,-52.7 c 6.2,-6.2 6.2,-16.4 0,-22.6 -6.2,-6.2 -16.4,-6.2 -22.6,0 L 256,233.4 203.3,180.7 c -6.2,-6.2 -15.6,-7.1 -22.6,0 -7.1,7.1 -6,16.6 0,22.6 l 52.7,52.7 -52.7,52.7 c -6.7,6.7 -6.4,16.3 0,22.6 6.4,6.4 16.4,6.2 22.6,0 l 52.7,-52.7 52.7,52.7 c 6.2,6.2 16.4,6.2 22.6,0 6.3,-6.2 6.3,-16.4 0,-22.6 z"></Path>
                        </Button>
                        <Button Style="{StaticResource FlatCircleButtonStyle}"
                                Height="20" 
                                Width="20"                
                                Background="Yellow"
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddRatioCommand}"
                                CommandParameter="0">
                            <Path Stretch="Uniform" Fill="Green" Data="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"></Path>
                        </Button>
                        <Button Style="{StaticResource FlatCircleButtonStyle}" 
                                Height="20" 
                                Width="20"                
                                Background="Yellow"
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddRatioCommand}"
                                CommandParameter="0.125">
                            <Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C13.93 5 15.68 5.78 16.95 7.05L12 12V5Z"></Path>
                        </Button>
                        <Button Style="{StaticResource FlatCircleButtonStyle}"
                                Height="20" 
                                Width="20"                
                                Background="Yellow"
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddRatioCommand}"
                                CommandParameter="0.25">
                            <Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12H12V5Z"></Path>
                        </Button>
                        <Button Style="{StaticResource FlatCircleButtonStyle}" 
                                Height="20" 
                                Width="20"                
                                Background="Yellow" 
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddRatioCommand}"
                                CommandParameter="0.375">
                            <Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12C19 13.93 18.22 15.68 16.95 16.95L12 12V5Z"></Path>
                        </Button>
                        <Button Style="{StaticResource FlatCircleButtonStyle}" 
                                Height="20" 
                                Width="20"                
                                Background="Yellow"
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddRatioCommand}"
                                CommandParameter="0.5">
                            <Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19V5Z"></Path>
                        </Button>
                        <Button Style="{StaticResource FlatCircleButtonStyle}" 
                                Height="20" 
                                Width="20"                
                                Background="Yellow" 
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddRatioCommand}"
                                CommandParameter="0.625">
                            <Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19C10.07 19 8.32 18.22 7.05 16.95L12 12V5Z"></Path>
                        </Button>
                        <Button Style="{StaticResource FlatCircleButtonStyle}" 
                                Height="20"
                                Width="20"                
                                Background="Yellow"
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddRatioCommand}"
                                CommandParameter="0.75">
                            <Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19C8.13 19 5 15.87 5 12H12V5Z"></Path>
                        </Button>
                        <Button Style="{StaticResource FlatCircleButtonStyle}" 
                                Height="20" 
                                Width="20"                
                                Background="Yellow"
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddRatioCommand}"
                                CommandParameter="0.875">
                            <Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19C8.13 19 5 15.87 5 12C5 10.07 5.78 8.32 7.05 7.05L12 12V5Z"></Path>
                        </Button>
                        <Button Style="{StaticResource FlatCircleButtonStyle}" 
                                Height="20" 
                                Width="20"                
                                Background="Yellow"
                                Margin="2"
                                Command="{Binding PageViewModel.DiagramViewModel.AddRatioCommand}"
                                CommandParameter="1">
                            <Path Stretch="Uniform" Fill="Green" Data="m 256,76 c 48.1,0 93.3,18.7 127.3,52.7 34,34 52.7,79.2 52.7,127.3 0,48.1 -18.7,93.3 -52.7,127.3 -34,34 -79.2,52.7 -127.3,52.7 -48.1,0 -93.3,-18.7 -127.3,-52.7 C 94.7,349.3 76,304.1 76,256 76,207.9 94.7,162.7 128.7,128.7 162.7,94.7 207.9,76 256,76 m 0,-28 C 141.1,48 48,141.1 48,256 48,370.9 141.1,464 256,464 370.9,464 464,370.9 464,256 464,141.1 370.9,48 256,48 Z M 362.6,192.9 345,174.8 c -0.7,-0.8 -1.8,-1.2 -2.8,-1.2 -1.1,0 -2.1,0.4 -2.8,1.2 L 217.4,297.7 173,253.3 c -0.8,-0.8 -1.8,-1.2 -2.8,-1.2 -1,0 -2,0.4 -2.8,1.2 l -17.8,17.8 c -1.6,1.6 -1.6,4.1 0,5.7 l 56,56 c 3.6,3.6 8,5.7 11.7,5.7 5.3,0 9.9,-3.9 11.6,-5.5 H 229 L 362.7,198.6 c 1.4,-1.7 1.4,-4.2 -0.1,-5.7 z"></Path>
                        </Button>
                    </UniformGrid>
                    <Border BorderBrush="Gray" BorderThickness="1" CornerRadius="3" VerticalAlignment="Top" Margin="0,8,0,0">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="24"/>
                                <RowDefinition Height="24"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBox x:Name="txtTag" VerticalContentAlignment="Center" BorderThickness="0" Background="Transparent"/>
                            <Line X1="0" Y1="0" X2="0" Y2="100" Stroke="Gray"  StrokeThickness="0.5" HorizontalAlignment="Right"></Line>
                            <Button Grid.Column="1" Content="添加" Padding="6,0" Style="{StaticResource FlatButtonStyle}"  Command="{Binding PageViewModel.DiagramViewModel.AddTagCommand}" CommandParameter="{Binding ElementName=txtTag,Path=Text}"/>
                            <Line X1="0" Y1="0" X2="150" Y2="0" Stroke="Gray"  StrokeThickness="0.5" VerticalAlignment="Bottom" Grid.ColumnSpan="2"></Line>
                            <dd:TagControl Grid.Row="1" Grid.ColumnSpan="2" BorderBrush="Gray"  HorizontalAlignment="Left" ItemsSource="{Binding PageViewModel.DiagramViewModel.SelectedItem.Tags}" Width="150">
                                <dd:TagControl.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" x:Name="grid">
                                            <TextBlock Text="{Binding .}"/>
                                            <Button x:Name="clear" Style="{StaticResource FlatButtonStyle}" Padding="0" Content="X" Command="{Binding DataContext.PageViewModel.DiagramViewModel.RemoveTagCommand, RelativeSource={RelativeSource AncestorType={x:Type dd:TagControl}}}" CommandParameter="{Binding .}" Visibility="Collapsed"/>
                                        </StackPanel>
                                        <DataTemplate.Triggers>
                                            <Trigger Property="IsMouseOver" Value="True">
                                                <Setter TargetName="clear" Property="Visibility" Value="Visible"/>
                                            </Trigger>
                                        </DataTemplate.Triggers>
                                    </DataTemplate>
                                </dd:TagControl.ItemTemplate>
                            </dd:TagControl>
                        </Grid>
                    </Border>
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="外观" IsLauncherVisible="True">
                    <Fluent:SplitButton Header="{Binding ElementName=mindtype,Path=SelectedItem,Converter={StaticResource EnumDescriptionConverter}}" GroupName="MindType" Width="70" VerticalAlignment="Top" ClosePopupOnMouseDown="True">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconRemixIcon Kind="MindMap" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <ListBox x:Name="mindtype" Width="140" dd:EnumHelper.Enum="{x:Type dd:MindType}" SelectedItem="{Binding PageViewModel.DiagramViewModel.MindType}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="MindType"
                                              Text="脑图类型"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="{Binding ElementName=mindtheme,Path=SelectedItem,Converter={StaticResource EnumDescriptionConverter}}" Width="50" VerticalAlignment="Top" ClosePopupOnMouseDown="True">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconUnicons Kind="Palette" Foreground="{Binding PageViewModel.DiagramViewModel.MindTheme,Converter={StaticResource MindThemeFillBrushConverter}}"  VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <ListBox x:Name="mindtheme" dd:EnumHelper.Enum="{x:Type dd:MindTheme}" SelectedItem="{Binding PageViewModel.DiagramViewModel.MindTheme}">
                            <ListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <UniformGrid Columns="2"/>
                                </ItemsPanelTemplate>
                            </ListBox.ItemsPanel>
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Border CornerRadius="3" Background="{Binding .,Converter={StaticResource MindThemeFillBrushConverter}}" Padding="5">
                                        <TextBlock Foreground="{Binding .,Converter={StaticResource MindThemeFontBrushConverter}}" Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" VerticalAlignment="Center" />
                                    </Border>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Theme"
                                              Text="主题"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>

                    <Fluent:Button Header="整理布局" Width="50" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.ResetLayoutCommand}">
                        <Fluent:Button.LargeIcon>
                            <Path Width="15" Height="15" Stretch="Uniform" Fill="Black" Data="M358.4 0a102.4 102.4 0 0 1 102.4 102.4v819.2a102.4 102.4 0 0 1-102.4 102.4H102.4a102.4 102.4 0 0 1-102.4-102.4V102.4a102.4 102.4 0 0 1 102.4-102.4h256z m0 76.8H102.4a25.6 25.6 0 0 0-25.1904 20.992L76.8 102.4v819.2a25.6 25.6 0 0 0 20.992 25.1904L102.4 947.2h256a25.6 25.6 0 0 0 25.1904-20.992L384 921.6V102.4a25.6 25.6 0 0 0-20.992-25.1904L358.4 76.8z m268.288 547.84a38.4 38.4 0 0 1 50.1248-1.8432l4.1472 3.8912a38.4 38.4 0 0 1 1.8432 50.1248L630.272 742.4h333.7216l4.6592 0.3584c16.7936 2.56 29.696 18.5856 29.696 38.0416 0 21.1968-15.36 38.4-34.3552 38.4h-333.6704l52.4288 65.6384 3.2256 4.6592a38.4 38.4 0 0 1-63.232 43.3152l-102.4-128-3.328-4.9152a38.4 38.4 0 0 1 3.328-43.0592l102.4-128zM921.6 0a102.4 102.4 0 0 1 102.4 102.4v256a102.4 102.4 0 0 1-102.4 102.4h-256a102.4 102.4 0 0 1-102.4-102.4V102.4a102.4 102.4 0 0 1 102.4-102.4h256z m0 76.8h-256a25.6 25.6 0 0 0-25.1904 20.992L640 102.4v256a25.6 25.6 0 0 0 20.992 25.1904L665.6 384h256a25.6 25.6 0 0 0 25.1904-20.992L947.2 358.4V102.4a25.6 25.6 0 0 0-20.992-25.1904L921.6 76.8z"></Path>
                        </Fluent:Button.LargeIcon>
                    </Fluent:Button>
                    <Fluent:Button Header="清除样式" SizeDefinition="Middle" Width="80" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.ClearThemeCommand}">
                        <Fluent:Button.Icon>
                            <Path Width="15" Height="15" Stretch="Uniform" Fill="Black" Data="M719.329882 422.249412l-255.578353 255.578353 234.315295 234.315294 255.518117-255.638588-234.315294-234.255059zM59.151059 315.813647l298.164706-298.164706a60.235294 60.235294 0 0 1 85.172706 0l596.329411 596.329412a60.235294 60.235294 0 0 1 0 85.172706l-298.164706 298.164706a60.235294 60.235294 0 0 1-85.232941 0l-596.329411-596.329412a60.235294 60.235294 0 0 1 0-85.172706z"></Path>
                        </Fluent:Button.Icon>
                    </Fluent:Button>
                    <Fluent:Button Header="复制样式" SizeDefinition="Middle" Width="80" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.CopyThemeCommand}">
                        <Fluent:Button.Icon>
                            <Path Width="15" Height="15" Stretch="Uniform" Fill="Black" Data="M701.248 177.6l175.104-113.024 83.456 114.88-131.136 162.304-127.424-164.16z m-133.376-61.568c51.264 6.976 300.608 346.624 294.272 384.704s-145.536 143.68-145.536 143.68L400.64 238.592s116.032-129.6 167.232-122.56zM370.368 288.448l305.024 396.672-187.136 272L65.664 359.04s83.776-3.84 153.536-24.32c45.632-13.504 151.232-46.272 151.168-46.272z"></Path>
                        </Fluent:Button.Icon>
                    </Fluent:Button>
                    <Fluent:Button Header="粘贴样式" SizeDefinition="Middle" Width="80" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.PasteThemeCommand}">
                        <Fluent:Button.Icon>
                            <Path Width="15" Height="15" Stretch="Uniform" Fill="Black" Data="M411.880727 905.169455v-279.272728h149.876364v279.272728z m54.272-279.645091v-124.881455h412.904728V325.771636h-64.605091v116.363637h-698.181819v-279.272728h698.181819v116.363637h111.104v268.055273h-412.904728v78.289454z"></Path>
                        </Fluent:Button.Icon>
                    </Fluent:Button>
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="视图" IsLauncherVisible="True">
                    <Fluent:SplitButton Header="展开" GroupName="Expand" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconForkAwesome Kind="PlusSquareOutline" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:MenuItem Header="展开到一级节点" Command="{Binding PageViewModel.DiagramViewModel.Expand2LevelCommand}" CommandParameter="1"/>
                        <Fluent:MenuItem Header="展开到二级节点" Command="{Binding PageViewModel.DiagramViewModel.Expand2LevelCommand}" CommandParameter="2"/>
                        <Fluent:MenuItem Header="展开到三级节点" Command="{Binding PageViewModel.DiagramViewModel.Expand2LevelCommand}" CommandParameter="3"/>
                        <Fluent:MenuItem Header="展开到四级节点" Command="{Binding PageViewModel.DiagramViewModel.Expand2LevelCommand}" CommandParameter="4"/>
                        <Fluent:MenuItem Header="展开到五级节点" Command="{Binding PageViewModel.DiagramViewModel.Expand2LevelCommand}" CommandParameter="5"/>
                        <Fluent:MenuItem Header="展开到六级节点" Command="{Binding PageViewModel.DiagramViewModel.Expand2LevelCommand}" CommandParameter="6"/>
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Expand"
                                              Text="展开"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                    <Fluent:SplitButton Header="全选" GroupName="Select" Width="50" VerticalAlignment="Top">
                        <Fluent:SplitButton.LargeIcon>
                            <iconPacks:PackIconVaadinIcons Kind="AreaSelect" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:SplitButton.LargeIcon>
                        <Fluent:MenuItem Header="全选" Command="{Binding PageViewModel.DiagramViewModel.SelectAllCommand}" />
                        <Fluent:MenuItem Header="反选" Command="{Binding PageViewModel.DiagramViewModel.SelectInverseCommand}" />
                        <Fluent:MenuItem Header="选择兄弟节点" Command="{Binding PageViewModel.DiagramViewModel.SelectBrotherCommand}" />
                        <Fluent:MenuItem Header="选择同级节点" Command="{Binding PageViewModel.DiagramViewModel.SelectPearCommand}" />
                        <Fluent:MenuItem Header="选择路径" Command="{Binding PageViewModel.DiagramViewModel.SelectRouteCommand}" />
                        <Fluent:MenuItem Header="选择子树" Command="{Binding PageViewModel.DiagramViewModel.SelectChildCommand}" />
                        <Fluent:SplitButton.ToolTip>
                            <Fluent:ScreenTip Title="Select"
                                              Text="全选"
                                              Width="190" />
                        </Fluent:SplitButton.ToolTip>
                    </Fluent:SplitButton>
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="视图">
                <Fluent:RibbonGroupBox Header="适应窗口"
                                       IsLauncherVisible="True"   >
                    <Fluent:Button Header="居中" Width="50" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.CenterMoveCommand}">
                        <Fluent:Button.LargeIcon>
                            <iconPacks:PackIconMaterial Kind="ImageFilterCenterFocus" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:Button.LargeIcon>
                    </Fluent:Button>
                    <Fluent:Button Header="适应窗口大小" Width="90" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.FitAutoCommand}">
                        <Fluent:Button.LargeIcon>
                            <Path Width="18" Height="18" Stretch="Uniform" Fill="Black" RenderTransformOrigin="0.5,0.5" Data="M1023.216289 841.246459v9.61262a268.243293 268.243293 0 0 1-1.9339 51.191468 145.725046 145.725046 0 0 1-48.0631 85.66039 153.233128 153.233128 0 0 1-65.126924 31.681831 126.897961 126.897961 0 0 1-40.441259 2.218297H175.769975a293.611509 293.611509 0 0 1-66.776427-3.640282 142.198522 142.198522 0 0 1-100.221518-91.348331A239.291674 239.291674 0 0 1 0.524516 846.081209V193.560629 132.472144a164.950286 164.950286 0 0 1 16.551908-56.253736A147.886463 147.886463 0 0 1 93.806746 8.930067a155.735822 155.735822 0 0 1 26.505805-6.768649L134.077368 0.739432h734.654446a108.070877 108.070877 0 0 1 34.127646 1.421986 152.607454 152.607454 0 0 1 65.980114 29.122257 146.180081 146.180081 0 0 1 51.191468 84.522802 254.819752 254.819752 0 0 1 2.787091 55.116147V841.417097zM942.618167 129.457535a65.126923 65.126923 0 0 0-22.751764-35.322113 53.011609 53.011609 0 0 0-50.395156-13.025385H138.798359l-5.687941 0.568794-13.821696 3.697162a64.956285 64.956285 0 0 0-31.169917 26.847081 120.29995 120.29995 0 0 0-8.816308 61.657279v661.735044a245.548409 245.548409 0 0 0 1.9339 57.391324 63.648059 63.648059 0 0 0 41.920124 44.934733 172.060212 172.060212 0 0 0 45.844804 2.843971h702.858857a54.149197 54.149197 0 0 0 23.661834-1.421986 73.033161 73.033161 0 0 0 29.520413-16.096872 98.515136 98.515136 0 0 0 19.623396-81.166917V174.16475a199.077931 199.077931 0 0 0-2.047658-44.707215z m-116.090874 694.781981a37.085375 37.085375 0 0 1-19.850914 20.362828h-0.511915a36.232184 36.232184 0 0 1-13.366661 2.730212H597.75831a36.516581 36.516581 0 0 1-31.681831-18.713326 38.052325 38.052325 0 0 1 0-37.369772 36.516581 36.516581 0 0 1 31.681831-18.713325h106.762651l-120.413709-123.030162a37.881686 37.881686 0 0 1-9.953897-36.345942 36.914736 36.914736 0 0 1 26.107649-26.676443 35.890907 35.890907 0 0 1 35.549631 10.181414l120.413708 123.030162v-109.151586a37.54041 37.54041 0 0 1 18.258291-32.364384 36.004666 36.004666 0 0 1 36.57346 0 37.54041 37.54041 0 0 1 18.25829 32.364384v199.419208a37.199133 37.199133 0 0 1-2.559573 13.594179zM402.775696 249.359329H296.297442l120.35683 123.087041a37.938566 37.938566 0 0 1 9.498861 36.118425 36.971616 36.971616 0 0 1-25.880131 26.448925 36.004666 36.004666 0 0 1-35.322113-9.6695L244.59406 302.2003v109.151586a37.654169 37.654169 0 0 1-18.31517 32.421263 36.004666 36.004666 0 0 1-36.57346 0 37.711048 37.711048 0 0 1-18.25829-32.421263V211.989557a36.857857 36.857857 0 0 1 2.616452-13.594178v-0.625674a36.914736 36.914736 0 0 1 19.907794-20.305949h0.568794a34.525801 34.525801 0 0 1 13.309781-2.673332h195.039494a36.459701 36.459701 0 0 1 31.681831 18.656446 38.166083 38.166083 0 0 1 0 37.426651 36.459701 36.459701 0 0 1-31.79559 18.485808z">
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Fluent:Button.LargeIcon>
                    </Fluent:Button>
                    <Fluent:Button Header="适应窗口宽度" Width="90" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.FitWidthCommand}">
                        <Fluent:Button.LargeIcon>
                            <Path Width="18" Height="18" Stretch="Uniform" Fill="Black" Data="M113.777 819.198 113.777 204.8c0-50.267 40.75-91.022 91.02-91.022l614.376 0c50.29 0 91.045 40.755 91.045 91.022l0 614.398c0 50.27-40.755 91.02-91.045 91.02L204.797 910.218C154.527 910.218 113.777 869.468 113.777 819.198zM796.438 841.953c25.125 0 45.51-20.385 45.51-45.51L841.948 227.554c0-25.122-20.385-45.51-45.505-45.51L227.552 182.044c-25.125 0-45.535 20.387-45.535 45.51l0 568.889c0 25.125 20.39 45.51 45.535 45.51L796.438 841.953zM623.043 603.269l57.115-57.14L344.357 546.129l55.5 55.505c13.31 13.335 13.335 34.93 0 48.265-13.335 13.33-34.95 13.33-48.29 0l-105.765-105.77c-3.415-1.615-6.78-3.525-9.625-6.37-7.08-7.1-10.1-16.475-9.67-25.76-0.46-9.262 2.59-18.66 9.69-25.76 2.85-2.842 6.15-4.8 9.58-6.348l105.79-105.79c13.34-13.335 34.955-13.335 48.29 0 13.31 13.332 13.335 34.927 0 48.262l-55.5 55.502 335.802 0-57.115-57.117c-13.355-13.335-13.335-34.952 0-48.287s34.93-13.335 48.265 0l115.37 115.395c13.335 13.332 13.36 34.927 0 48.262l-115.37 115.395c-13.335 13.335-34.95 13.335-48.265 0C609.708 638.198 609.708 616.583 623.043 603.269z"></Path>
                        </Fluent:Button.LargeIcon>
                    </Fluent:Button>
                    <Fluent:Button Header="适应窗口高度" Width="90" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.FitHeightCommand}">
                        <Fluent:Button.LargeIcon>
                            <Path Width="18" Height="18" Stretch="Uniform" Fill="Black" Data="M819.198 910.218 204.799 910.218c-50.267 0-91.022-40.75-91.022-91.02L113.777 204.822c0-50.29 40.755-91.045 91.022-91.045l614.398 0c50.27 0 91.02 40.755 91.02 91.045l0 614.376C910.218 869.468 869.468 910.218 819.198 910.218zM841.953 227.554c0-25.122-20.385-45.51-45.51-45.51L227.554 182.044c-25.122 0-45.51 20.387-45.51 45.51l0 568.889c0 25.125 20.387 45.535 45.51 45.535l568.889 0c25.125 0 45.51-20.39 45.51-45.535L841.953 227.554zM603.268 400.952l-57.14-57.115 0 335.802 55.505-55.5c13.335-13.31 34.93-13.335 48.265 0 13.33 13.335 13.33 34.95 0 48.29l-105.77 105.765c-1.615 3.415-3.525 6.78-6.37 9.625-7.1 7.08-16.475 10.1-25.76 9.67-9.262 0.46-18.66-2.59-25.76-9.69-2.842-2.85-4.8-6.15-6.347-9.58l-105.79-105.79c-13.335-13.34-13.335-34.955 0-48.29 13.332-13.31 34.927-13.335 48.262 0l55.502 55.5L477.865 343.837l-57.117 57.115c-13.335 13.357-34.952 13.335-48.287 0s-13.335-34.93 0-48.265l115.395-115.37c13.332-13.335 34.927-13.357 48.262 0l115.395 115.37c13.335 13.335 13.335 34.952 0 48.265C638.198 414.286 616.583 414.286 603.268 400.952z"></Path>
                        </Fluent:Button.LargeIcon>
                    </Fluent:Button>
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
            <Fluent:RibbonTabItem Header="高级">
                <Fluent:RibbonGroupBox Header="查找"
                                       IsLauncherVisible="True"   >
                    <Fluent:Button Header="搜索" Width="50" VerticalAlignment="Top" Command="{Binding PageViewModel.DiagramViewModel.ShowSearchCommand}">
                        <Fluent:Button.LargeIcon>
                            <iconPacks:PackIconFontAwesome Kind="SearchSolid" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Fluent:Button.LargeIcon>
                    </Fluent:Button>
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="其他">
                    <Fluent:Button Header="截屏" Width="50" VerticalAlignment="Top" Command="{Binding ScreenshotCommand}">
                        <Fluent:Button.LargeIcon>
                            <Path  Width="18" Height="18" Stretch="Uniform" Fill="Black" Data="M810.666667 597.333333h-85.333334v128h-128v85.333334h128v128h85.333334v-128h128v-85.333334h-128zM128 768a42.666667 42.666667 0 0 0 42.666667 42.666667h128v-85.333334H213.333333v-85.333333H128v128zM810.666667 170.666667a42.666667 42.666667 0 0 0-42.666667-42.666667h-128v85.333333h85.333333v85.333334h85.333334V170.666667zM213.333333 213.333333h85.333334V128H170.666667a42.666667 42.666667 0 0 0-42.666667 42.666667v128h85.333333V213.333333zM128 384h85.333333v170.666667H128z m597.333333 0h85.333334v128h-85.333334zM384 128h170.666667v85.333333H384z m0 597.333333h128v85.333334H384z"/>
                        </Fluent:Button.LargeIcon>
                        <Fluent:Button.ToolTip>
                            <Fluent:ScreenTip Title="Screen"
                                              Text="截屏"
                                              Width="190" />
                        </Fluent:Button.ToolTip>
                    </Fluent:Button>
                </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 PageViewModel}"
                                     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>
                            <dd:DiagramTabControl 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>
                                        <Grid>
                                            <ScrollViewer x:Name="designerScrollViewer" 
                                                    Background="{DynamicResource GrayBrush8}"
                                                    HorizontalScrollBarVisibility="Auto"
                                                    VerticalScrollBarVisibility="Auto"
                                                    Focusable="False">
                                                <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 Path="DelayZoomValue"/>
                                                                <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 Path="DelayZoomValue"/>
                                                                <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>
                                            <dd:ZoomBox x:Name="zoomBox"
                                               Width="180"
                                               HorizontalAlignment="Left"
                                               VerticalAlignment="Bottom"
                                               OffSet="True"
                                               DesignerCanvas="{Binding ElementName=diagram}"
                                               MaximumZoomValue="{Binding MaximumZoomValue,Mode=TwoWay}"  
                                               MinimumZoomValue="{Binding MinimumZoomValue,Mode=TwoWay}"  
                                               ZoomValue="{Binding ZoomValue,Mode=TwoWay}"   
                                               FitViewModel="{Binding FitViewModel}"
                                               Margin="20,0,0,20" />
                                        </Grid>
                                    </DataTemplate>
                                </TabControl.ContentTemplate>
                            </dd:DiagramTabControl>
                        </DataTemplate>
                    </dragablz:TabablzControl.ContentTemplate>
                </dragablz:TabablzControl>

                <Border BorderBrush="Gray" Background="{DynamicResource WindowBackgroundBrush}" BorderThickness="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,24,18,0" 
                        Visibility="{Binding PageViewModel.DiagramViewModel.ShowSearch,Converter={StaticResource BooleanToVisibilityConverter}}">
                    <Grid Grid.IsSharedSizeScope="True">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid Height="24">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Column1"/>
                                <ColumnDefinition Width="*" SharedSizeGroup="Column2"/>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Column3"/>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Column4"/>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Column5"/>
                            </Grid.ColumnDefinitions>
                            <ToggleButton x:Name="replaceToggle" Width="20" Height="20" Padding="5,0" ToolTip="查找与替换切换">
                                <ToggleButton.Style>
                                    <Style BasedOn="{StaticResource FlatButtonStyle}" TargetType="{x:Type ToggleButton}">
                                        <Setter Property="Content">
                                            <Setter.Value>
                                                <Path Stretch="Uniform" Fill="Black" Data="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"></Path>
                                            </Setter.Value>
                                        </Setter>
                                        <Style.Triggers>
                                            <Trigger Property="IsChecked" Value="True">
                                                <Trigger.Setters>
                                                    <Setter Property="Content">
                                                        <Setter.Value>
                                                            <Path Stretch="Uniform" Fill="Black" Data="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z"></Path>
                                                        </Setter.Value>
                                                    </Setter>
                                                </Trigger.Setters>
                                            </Trigger>
                                        </Style.Triggers>
                                    </Style>
                                </ToggleButton.Style>
                            </ToggleButton>
                            <TextBox Grid.Column="1" Width="200" x:Name="txtsearch" Text="{Binding PageViewModel.DiagramViewModel.SearchText,Mode=OneWayToSource}" VerticalContentAlignment="Center" BorderThickness="0" Background="Transparent">
                                <TextBox.InputBindings>
                                    <KeyBinding Key="Enter" Command="{Binding PageViewModel.DiagramViewModel.SearchDownCommand}" CommandParameter="{Binding ElementName=txtsearch,Path=Text}"/>
                                </TextBox.InputBindings>
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="LostFocus">
                                        <i:InvokeCommandAction Command="{Binding PageViewModel.DiagramViewModel.SearchDownCommand}" CommandParameter="{Binding ElementName=txtsearch,Path=Text}"/>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBox>
                            <Line Grid.Column="1" X1="0" Y1="0" X2="0" Y2="100" Stroke="Gray"  StrokeThickness="0.5" HorizontalAlignment="Right"></Line>
                            <Button Grid.Column="2" Width="20" Height="20" Padding="5,0" ToolTip="查找上一个" Style="{StaticResource FlatButtonStyle}" Command="{Binding PageViewModel.DiagramViewModel.SearchUpCommand}" CommandParameter="{Binding ElementName=txtsearch,Path=Text}">
                                <Path Stretch="Uniform" Fill="Black" Data="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"></Path>
                            </Button>
                            <Button Grid.Column="3" Width="20" Height="20" Padding="5,0" ToolTip="查找下一个" Style="{StaticResource FlatButtonStyle}" Command="{Binding PageViewModel.DiagramViewModel.SearchDownCommand}" CommandParameter="{Binding ElementName=txtsearch,Path=Text}">
                                <Path Stretch="Uniform" Fill="Black" Data="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"></Path>
                            </Button>
                            <Button Grid.Column="4" Width="20" Height="20" Padding="5,0" ToolTip="关闭" Style="{StaticResource FlatButtonStyle}" Command="{Binding PageViewModel.DiagramViewModel.CloseSearchCommand}">
                                <Path Stretch="Uniform" Fill="Black" Data="M500 455.8125L727.875 227.8749999999999L772.1250000000001 272.0625L544.1875 500L772.1250000000001 727.875L727.9375 772.125L500 544.1875L272.125 772.125L227.9375000000001 727.875L455.8125 500L227.9375000000001 272.125L272.125 227.8749999999999L500 455.8125z"></Path>
                            </Button>
                            <Line Grid.ColumnSpan="5" X1="0" Y1="0" X2="300" Y2="0" Stroke="Gray"  StrokeThickness="0.5" VerticalAlignment="Bottom"></Line>
                        </Grid>
                        <Grid Grid.Row="1" Height="24" Visibility="{Binding ElementName=replaceToggle,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Column1"/>
                                <ColumnDefinition Width="*" SharedSizeGroup="Column2"/>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Column3"/>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Column4"/>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Column5"/>
                            </Grid.ColumnDefinitions>
                            <TextBox Grid.Column="1"  x:Name="txtreplace" Text="{Binding PageViewModel.DiagramViewModel.ReplaceText,Mode=OneWayToSource}" VerticalContentAlignment="Center" BorderThickness="0" Background="Transparent">
                            </TextBox>
                            <Line Grid.Column="1" X1="0" Y1="0" X2="0" Y2="100" Stroke="Gray"  StrokeThickness="0.5" HorizontalAlignment="Right"></Line>
                            <Button Grid.Column="2" Width="20" Height="20" Padding="5,0" ToolTip="替换" Style="{StaticResource FlatButtonStyle}" Command="{Binding PageViewModel.DiagramViewModel.ReplaceCommand}">
                                <Button.CommandParameter>
                                    <MultiBinding Converter="{StaticResource ObjectConverter}">
                                        <MultiBinding.Bindings>
                                            <Binding ElementName="txtsearch" Path="Text"/>
                                            <Binding ElementName="txtreplace" Path="Text"/>
                                        </MultiBinding.Bindings>
                                    </MultiBinding>
                                </Button.CommandParameter>
                                <Path Stretch="Uniform" Fill="Black" Data="M940.3 761.5c-8.5-13.3-19.3-24.8-31.9-34.1 13.3-19.5 20.7-43.7 20.7-69.2 0-61.5-43-111.5-95.9-111.5H671.8c-29.3 0-53.1 23.8-53.1 53.1v304c0 29.3 23.8 53.1 53.1 53.1h160.4c34.3 0 66.6-13.5 90.9-37.9 24.1-24.2 37.3-56 37.1-89.7 0-24.2-6.9-47.6-19.9-67.8z m-67.6 107.7c-10.6 10.6-24.7 16.5-39.5 16.5H689.8V773.6h143.3c14.8 0 28.9 5.9 39.5 16.5 10.6 10.6 16.5 24.7 16.5 39.5s-5.8 29-16.4 39.6z m-25.3-178.9c-2.1 2.5-7.7 8.4-14.3 8.4H689.8v-80.9h143.3c6.6 0 12.2 5.9 14.3 8.4 6.6 8 10.6 20 10.6 32.1 0 12-3.9 24-10.6 32zM456 406.6l-128-320C322.5 73 309.3 64 294.5 64h-64c-14.7 0-28 9-33.4 22.6l-128 320c-7.4 18.5 1.6 39.4 20.1 46.8 18.5 7.4 39.4-1.6 46.8-20.1L178.1 328H347l42.1 105.4c5.6 14.1 19.1 22.6 33.4 22.6 4.5 0 9-0.8 13.4-2.6 18.5-7.4 27.5-28.3 20.1-46.8zM206.9 256l48-120h15.3l48 120H206.9z m345.8 582.3l-113.5 67c-5.7 3.4-12 5-18.3 5-12.3 0-24.3-6.3-31-17.7-10.1-17.1-4.4-39.2 12.7-49.3l38.9-23c-47.1-14.5-88.6-35.2-124.1-62-40.2-30.3-72.5-68.1-96-112.5-39.9-75.3-40.6-143.8-40.6-146.7v-0.1c0-19.9 16.1-36 36-36s35.9 16.1 36 35.9v-0.2c0 0.6 1 56.1 33.6 116 18.7 34.4 44.3 63.8 75.9 87.2 29 21.5 63.4 38.3 102.6 50.1l-23-44.1c-9.2-17.6-2.4-39.4 15.3-48.6 17.6-9.2 39.4-2.4 48.6 15.3l60.5 115.9c8.9 17.1 2.9 38.1-13.6 47.8z"></Path>
                            </Button>
                            <Button Grid.Column="3" Width="20" Height="20" Padding="5,0" ToolTip="全部替换" Style="{StaticResource FlatButtonStyle}" Command="{Binding PageViewModel.DiagramViewModel.ReplaceAllCommand}">
                                <Button.CommandParameter>
                                    <MultiBinding Converter="{StaticResource ObjectConverter}">
                                        <MultiBinding.Bindings>
                                            <Binding ElementName="txtsearch" Path="Text"/>
                                            <Binding ElementName="txtreplace" Path="Text"/>
                                        </MultiBinding.Bindings>
                                    </MultiBinding>
                                </Button.CommandParameter>
                                <Path Stretch="Uniform" Fill="Black" Data="M618.368 905.813333a88.32 88.32 0 0 1-87.082667-87.082666v-209.408a88.362667 88.362667 0 0 1 87.082667-87.082667h209.408a88.234667 88.234667 0 0 1 87.082667 87.082667v209.408a88.192 88.192 0 0 1-87.082667 87.082666z m-22.912-296.490666v209.408a24.448 24.448 0 0 0 22.912 22.997333h209.408a24.704 24.704 0 0 0 23.168-22.997333v-209.408a24.661333 24.661333 0 0 0-23.168-22.912h-209.408a24.448 24.448 0 0 0-23.04 22.912zM224.853333 826.666667a260.010667 260.010667 0 0 1-69.077333-169.514667h-33.237333l66.090666-110.250667 66.346667 110.250667H219.733333a196.266667 196.266667 0 0 0 51.2 125.354667 213.333333 213.333333 0 0 0 148.992 59.264 32.042667 32.042667 0 1 1 0 64 277.034667 277.034667 0 0 1-195.029333-79.274667z m-28.842666-324.821334a88.405333 88.405333 0 0 1-87.082667-87.082666v-209.066667a88.448 88.448 0 0 1 87.082667-87.338667h209.408a88.405333 88.405333 0 0 1 87.082666 87.338667v209.066667a86.144 86.144 0 0 1-87.082666 87.082666z m-23.168-296.32v209.066667a24.917333 24.917333 0 0 0 23.168 23.168h209.408a22.272 22.272 0 0 0 23.168-23.168v-209.066667a24.704 24.704 0 0 0-23.168-23.168H196.010667a24.704 24.704 0 0 0-23.082667 23.125334z m596.181333 165.077334h35.328a196.693333 196.693333 0 0 0-51.2-128.853334 213.333333 213.333333 0 0 0-149.333333-59.434666 32.085333 32.085333 0 0 1 0-64 277.333333 277.333333 0 0 1 195.157333 79.232 261.205333 261.205333 0 0 1 69.504 173.184h32.853333l-62.421333 110.250666z"></Path>
                            </Button>
                            <Line Grid.ColumnSpan="5" X1="0" Y1="0" X2="300" Y2="0" Stroke="Gray"  StrokeThickness="0.5" VerticalAlignment="Bottom"></Line>
                        </Grid>
                        <Grid Grid.Row="2" Height="24">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Column1"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel Grid.Column="1" Orientation="Horizontal">
                                <ToggleButton Width="20" Height="20" Padding="2,0" ToolTip="区分大小写" IsChecked="{Binding PageViewModel.DiagramViewModel.SearchCaseMatch}">
                                    <Path Stretch="Uniform" Fill="Black" Data="M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.19,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6Z"></Path> 
                                    <ToggleButton.Style>
                                        <Style BasedOn="{StaticResource FlatButtonStyle}" TargetType="{x:Type ToggleButton}">
                                            <Setter Property="Background" Value="Transparent"/>                                  
                                            <Style.Triggers>
                                                <Trigger Property="IsChecked" Value="True">
                                                    <Trigger.Setters>
                                                        <Setter Property="Background" Value="#cce4f7" />
                                                    </Trigger.Setters>
                                                </Trigger>
                                            </Style.Triggers>
                                        </Style>
                                    </ToggleButton.Style>
                                </ToggleButton>
                                <ToggleButton Width="20" Height="20" Padding="2,0" ToolTip="全字匹配" IsChecked="{Binding PageViewModel.DiagramViewModel.SearchWholeWordMatch}">
                                    <Path Stretch="Uniform" Fill="Black" RenderTransformOrigin="0.5,0.5" Data="M62.5 875H937.5V812.5H62.5V875zM875 750H812.5V250H875V750zM704.5 475.8125A147.06250000000003 147.06250000000003 0 0 1 682 524.9375A109.125 109.125 0 0 1 643.9375 558.0625A114.5 114.5 0 0 1 589.8125000000001 570.125C577.4375 570.125 566.0625 568.625 555.625 565.5624999999999A109.99999999999999 109.99999999999999 0 0 1 527.3125000000001 552.7499999999999A107.75 107.75 0 0 1 504.5000000000001 532.875L493.3125000000001 516.75V713.875H437.5V250H493.3125V285.9375L501.1875 274.9999999999999C506.625 268.6249999999999 513 263.1249999999999 520.1875 258.1874999999999C527.5000000000001 253.3124999999999 535.7500000000001 249.4374999999999 545.0625 246.5624999999999C554.375 243.6875 564.6875 242.3124999999999 576.1875 242.3124999999999C598.25 242.3124999999999 617.8125 246.7499999999999 634.7499999999999 255.5624999999999C651.7499999999999 264.5 665.9375 276.6874999999999 677.375 292.1874999999999C688.8124999999999 307.8124999999999 697.4374999999999 326.1249999999999 703.2499999999999 347.1249999999999C709.0624999999999 368.2499999999999 712 391.0624999999999 712 415.6874999999999A234.74999999999997 234.74999999999997 0 0 1 704.5 475.8124999999999zM612.0625 513.75C621.4999999999999 509.3125 629.6875 502.75 636.4375 494.1250000000001C643.25 485.375 648.5625 474.5625 652.375 461.8125000000001C655.5625 450.9375000000001 657.5000000000001 438.625 657.9375000000001 425.1250000000001L657.5000000000001 417.3125000000001C657.5000000000001 396.8750000000001 655.4375000000001 378.5625000000001 651.2500000000001 363.0000000000001A117.87500000000001 117.87500000000001 0 0 0 633.8750000000001 324.625C626.5625 314.5 617.6250000000001 306.8125 607.5625000000001 301.7500000000001C587.4375000000001 291.625 560.0625000000001 291.375 540.7500000000001 300.8125A79 79 0 0 0 516.1875 319.3125A79.5625 79.5625 0 0 0 502.5625 342.25S491.375 370.1874999999999 491.375 401.4374999999999C491.375 432.6874999999999 502.5625 464.0624999999999 502.5625 464.0624999999999C506.4375 475.1249999999999 511.0625 483.9374999999999 516.5625 490.9374999999999C523.6875000000001 499.8749999999999 532.5625 507.1249999999999 543.0625 512.4999999999999C553.5625 517.875 565.875 520.5625 579.75 520.5625C591.625 520.5625 602.5 518.25 612.0625 513.75zM937.5 187.5H62.5V125H937.5V187.5zM175.8125 375L130.3125 248.0625H62.5L64.0625 252.5624999999999L216.625 695.4375H275.4375L430.75 248.0624999999999H363.125L314.5 375H175.8125zM245.875 598.625H244.5000000000001L187.9375 426.5625H303.0000000000001L245.8750000000001 598.625z">
                                        <Path.RenderTransform>
                                            <ScaleTransform ScaleY="-1"/>
                                        </Path.RenderTransform>
                                    </Path>
                                    <ToggleButton.Style>
                                        <Style BasedOn="{StaticResource FlatButtonStyle}" TargetType="{x:Type ToggleButton}">
                                            <Setter Property="Background" Value="Transparent"/>
                                            <Style.Triggers>
                                                <Trigger Property="IsChecked" Value="True">
                                                    <Trigger.Setters>
                                                        <Setter Property="Background" Value="#cce4f7" />
                                                    </Trigger.Setters>
                                                </Trigger>
                                            </Style.Triggers>
                                        </Style>
                                    </ToggleButton.Style>
                                </ToggleButton>
                                <TextBlock Grid.Column="1" Margin="2,0,0,0" VerticalAlignment="Center" Text="{Binding PageViewModel.DiagramViewModel.SearchInfo}"/>
                            </StackPanel>                         
                        </Grid>
                    </Grid>
                </Border>
                <DockPanel Grid.Row="1" >
                    <Fluent:ComboBox Size="Small" IsEditable="False" dd: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 PageViewModel.DiagramViewModels}"
                         SelectedItem="{Binding PageViewModel.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 PageViewModel.AddPageCommand}" CommandParameter="{Binding .}"/>
                                            <MenuItem Header="复制页" Command="{binding:ControlBinding PageViewModel.AddCopyPageCommand}" CommandParameter="{Binding .}"/>
                                            <MenuItem Header="重命名页" Command="{binding:ControlBinding PageViewModel.RenamePageCommand}" CommandParameter="{Binding .}"/>
                                            <MenuItem Header="删除页" Command="{binding:ControlBinding PageViewModel.DeletePageCommand}" CommandParameter="{Binding .}"/>
                                        </ContextMenu>
                                    </Grid.ContextMenu>
                                    <TextBlock Text="{Binding Name}" Visibility="{Binding IsEditName,Converter={StaticResource Boolean2VisibilityReConverter}}">
                                        <TextBlock.InputBindings>
                                            <MouseBinding MouseAction="LeftDoubleClick" Command="{binding:ControlBinding PageViewModel.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 PageViewModel.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 PageViewModel.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 PageViewModel.AddPageCommand}"/>
                </StackPanel>
            </Fluent:StatusBarItem>

            <Separator HorizontalAlignment="Left" />

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

            <Separator HorizontalAlignment="Right" />

            <Fluent:StatusBarItem Title="Mouse" HorizontalAlignment="Right" >
                <StackPanel Orientation="Horizontal">
                    <TextBlock VerticalAlignment="Center" Width="150">
                        <Run>鼠标位置(mm)：</Run>
                        <Run Text="{Binding PageViewModel.DiagramViewModel.CurrentPoint.X,StringFormat=f1}"/>
                         <Run>,</Run>
                        <Run Text="{Binding PageViewModel.DiagramViewModel.CurrentPoint.Y,StringFormat=f1}"/>
                    </TextBlock>
                    <Rectangle Width="12" Height="12" Margin="5" VerticalAlignment="Center">
                        <Rectangle.Fill>
                            <SolidColorBrush Color="{Binding PageViewModel.DiagramViewModel.CurrentColor}" />
                        </Rectangle.Fill>
                    </Rectangle>
                    <TextBlock Width="66" VerticalAlignment="Center" Text="{Binding PageViewModel.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="{Binding PageViewModel.DiagramViewModel.MinimumZoomValue}"
                        Value="{Binding PageViewModel.DiagramViewModel.ZoomValue}"
                        Maximum="{Binding PageViewModel.DiagramViewModel.MaximumZoomValue}"
                        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>
