Browse Source

编辑PDF - 右键菜单,对齐

chenrongqian 2 years ago
parent
commit
c6c096db73

+ 132 - 18
PDF Office/ViewModels/PropertyPanel/TextEditPropertyViewModel.cs

@@ -24,6 +24,17 @@ namespace PDF_Office.ViewModels.PropertyPanel
 
         #region 编辑PDF全局
 
+        private bool _isSelectTextAndImg = false;
+        public bool IsSelectTextAndImg
+        {
+            get { return _isSelectTextAndImg; }
+            set
+            {
+                SetProperty(ref _isSelectTextAndImg, value);
+
+            }
+        }
+
         private bool _isLayoutAvgAlign = false;
         public bool IsLayoutAvgAlign
         {
@@ -218,6 +229,8 @@ namespace PDF_Office.ViewModels.PropertyPanel
 
         public DelegateCommand<object> TextAlignCheckedCommand { get; set; }
 
+        public DelegateCommand EditTextModeCommand { get; set; }
+
         #endregion
 
         #region 图像Command
@@ -276,6 +289,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
             FontStyleChangedCommand = new DelegateCommand<object>(FontStyleChanged);
             FontSizeChangedCommand = new DelegateCommand<object>(FontSizeChanged);
             TextAlignCheckedCommand = new DelegateCommand<object>(TextAlignChecked);
+            EditTextModeCommand = new DelegateCommand(EditTextMode);
 
             AntiClockwiseCommand = new DelegateCommand(AntiClockwise);
             ClockwiseCommand = new DelegateCommand(Clockwise);
@@ -608,31 +622,41 @@ namespace PDF_Office.ViewModels.PropertyPanel
                     if (e.EditType == ComPDFKit.PDFPage.CPDFEditType.None)
                     {
                         e.PopupMenu = EmptyStateMenu(sender);
-                        if (e.PopupMenu != null)
-                        {
-                            e.Handle = true;
-                        }
+                       
                     }
                     else if(e.EditType == ComPDFKit.PDFPage.CPDFEditType.EditImage)
                     {
                         e.PopupMenu = SelectPDFEdit(sender);
-                        if (e.PopupMenu != null)
-                        {
-                            e.Handle = true;
-                        }
                     }
                     else if(e.EditType == ComPDFKit.PDFPage.CPDFEditType.EditText)
                     {
-                     //   e.SelectText
+                        //文字编辑
+                        if(e.PressOnBorder == true)
+                        {
+                            e.PopupMenu = SelectTextBorder(sender);
+                        }
+
+                        if(e.PressOnSelectedText == true)
+                        {
+                            e.PopupMenu = SelectTextContent(sender);
+                        }
                     }
 
-            break;
+                    break;
 
                 default:
                     e.DoCommand();
                     break;
 
             }
+            if (e.PopupMenu != null)
+            {
+                e.Handle = true;
+            }
+        }
+        private void EditTextMode()
+        {
+            
         }
 
         private ContextMenu EmptyStateMenu(object sender)
@@ -694,6 +718,72 @@ namespace PDF_Office.ViewModels.PropertyPanel
             return popMenu;
         }
 
+
+        private ContextMenu SelectTextBorder(object sender)
+        {
+            var popMenu = App.Current.FindResource("SelectTextMenu") as ContextMenu;
+            if (popMenu != null && popMenu.Items.Count == 5)
+            {
+                //编辑
+                MenuItem menuItem = popMenu.Items[0] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = EditTextModeCommand;
+                //复制
+                menuItem = popMenu.Items[1] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Copy;
+                //剪切
+                menuItem = popMenu.Items[2] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Cut;
+                //粘贴
+                menuItem = popMenu.Items[3] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Paste;
+                //删除
+                menuItem = popMenu.Items[4] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Delete;
+
+            }
+            return popMenu;
+        }
+
+
+        private ContextMenu SelectTextContent(object sender)
+        {
+            var popMenu = App.Current.FindResource("SelectContentMenu") as ContextMenu;
+            if (popMenu != null && popMenu.Items.Count == 6)
+            {
+                //复制
+                MenuItem menuItem = popMenu.Items[0] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Copy;
+                //剪切
+                menuItem = popMenu.Items[1] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Cut;
+                //粘贴
+                menuItem = popMenu.Items[2] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Paste;
+                //粘贴并匹配样式
+                menuItem = popMenu.Items[3] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Paste;
+                //删除
+                menuItem = popMenu.Items[4] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Delete;
+                //全部选定
+                menuItem = popMenu.Items[4] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.SelectAll;
+            }
+
+            return popMenu;
+        }
+
         private void PDFViewer_PDFEditActiveHandler(object sender, List<PDFEditEvent> e)
         {
             if(e != null && e.Count > 0)
@@ -703,42 +793,67 @@ namespace PDF_Office.ViewModels.PropertyPanel
 
                 IsTextEdit = (e[0].EditType == ComPDFKit.PDFPage.CPDFEditType.EditText);
                 TextEditEvent = e[0];
-                
+
                 if (IsTextEdit == false)
                 {
                     var list = PDFViewer.GetSelectedImages();
-                    if(list != null && list.Count > 0)
+                    if (list != null && list.Count > 0)
                     {
                         System.Drawing.Bitmap bitmap = null;
                         foreach (var item in list)
                         {
-                            if(item.Value.Count>0)
+                            if (item.Value.Count > 0)
                             {
                                 bitmap = item.Value[0];
                                 break;
                             }
                         }
 
-                        if(bitmap != null)
+                        if (bitmap != null)
                         {
                             IntPtr ip = bitmap.GetHbitmap();
                             System.Windows.Media.Imaging.BitmapSource bitmapSource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(ip, IntPtr.Zero, Int32Rect.Empty,
                             System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
                             CurrentImg = bitmapSource;
                         }
-                       
+
+                    }
+
+
+                }
+
+                bool isText = false;
+                bool isImg = false;
+
+                foreach (var item in e)
+                {
+                    if (item.EditType == ComPDFKit.PDFPage.CPDFEditType.EditText)
+                    {
+                        isText = true;
+                    }
+
+                    if (item.EditType == ComPDFKit.PDFPage.CPDFEditType.EditImage)
+                    {
+                        isImg = true;
                     }
-                    
 
                 }
 
+                if (isImg == true && isText == true)
+                    IsSelectTextAndImg = true;
+                else
+                    IsSelectTextAndImg = false;
+
             }
             else
             {
                 IsLayoutAlign = false;
                 IsLayoutAvgAlign = false;
-                ClearCheckedAglin?.Invoke(null, null);
+                IsSelectTextAndImg = false;
                 IsTextEdit = true;
+
+                ClearCheckedAglin?.Invoke(null, null);
+               
             }
         }
 
@@ -753,7 +868,6 @@ namespace PDF_Office.ViewModels.PropertyPanel
                 IsLayoutAvgAlign = true;
             else
                 IsLayoutAvgAlign = false;
-
         }
 
     }

+ 397 - 384
PDF Office/Views/PropertyPanel/TextEditProperty.xaml

@@ -49,452 +49,465 @@
         </ResourceDictionary>
     </UserControl.Resources>
     <Grid Background="#F3F3F3">
-        <StackPanel Visibility="{Binding IsTextEdit,Converter={StaticResource BoolToVisible}}">
-            <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Freetext</TextBlock>
-            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
-                <Grid>
-                    <Border Name="FreeTextBorder" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5">
-                        <TextBlock Name="SampleText"
+        <Grid.RowDefinitions>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition Height="Auto"/>
+        </Grid.RowDefinitions>
+        <Grid Visibility="{Binding IsSelectTextAndImg,Converter={StaticResource InvertBoolToVisibleConvert}}">
+
+            <StackPanel Visibility="{Binding IsTextEdit,Converter={StaticResource BoolToVisible}}">
+                <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Freetext</TextBlock>
+                <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
+                    <Grid>
+                        <Border Name="FreeTextBorder" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5">
+                            <TextBlock Name="SampleText"
                                    Foreground="{Binding SelectColor}" 
                                    FontFamily="{Binding TextFontFamily}"
                                    FontWeight="{Binding TextFontWeights}" 
                                    FontStyle="{Binding TextFontStyle}"
                                    FontSize="{Binding TextFontSize}" 
                                    Text="Sample" HorizontalAlignment="Center" VerticalAlignment="Center">
-                        </TextBlock>
-                    </Border>
-
-                    <Path Name="UnderlinePath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
-                        <Path.Data>
-                            <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
-                        </Path.Data>
-                    </Path>
-                    <Path Name="StrikeoutPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,40,0,0" Visibility="Collapsed">
-                        <Path.Data>
-                            <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
-                        </Path.Data>
-                    </Path>
-                    <Path Name="SquigglyPath"  HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
-
-                    </Path>
-                </Grid>
-            </Border>
+                            </TextBlock>
+                        </Border>
+
+                        <Path Name="UnderlinePath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
+                            <Path.Data>
+                                <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
+                            </Path.Data>
+                        </Path>
+                        <Path Name="StrikeoutPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,40,0,0" Visibility="Collapsed">
+                            <Path.Data>
+                                <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
+                            </Path.Data>
+                        </Path>
+                        <Path Name="SquigglyPath"  HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
+
+                        </Path>
+                    </Grid>
+                </Border>
 
 
-            <Border BorderBrush="#E2E3E6"  Height="32" Margin="12,0,4,0"  BorderThickness="0">
-                <StackPanel Orientation="Horizontal">
-                    <ComboBox IsReadOnly="True" Name="FontTitleBox" Background="Transparent" Padding="10 10 0 0"  Width="148"   BorderThickness="1" BorderBrush="#FFE2E3E6"
+                <Border BorderBrush="#E2E3E6"  Height="32" Margin="12,0,4,0"  BorderThickness="0">
+                    <StackPanel Orientation="Horizontal">
+                        <ComboBox IsReadOnly="True" Name="FontTitleBox" Background="Transparent" Padding="10 10 0 0"  Width="148"   BorderThickness="1" BorderBrush="#FFE2E3E6"
                                 ItemsSource="{Binding FontStyleList}"
                               ItemTemplate="{StaticResource FontStyleData}"
                               >
-                        <i:Interaction.Triggers>
-                            <i:EventTrigger EventName="SelectionChanged">
-                                <i:InvokeCommandAction Command="{Binding SelectedFontStyleCommand}" CommandParameter="{Binding ElementName=FontTitleBox,Path=SelectedItem}"/>
-                            </i:EventTrigger>
-                        </i:Interaction.Triggers>
-                    </ComboBox>
-                    <Button Width="32" Height="32" ContextMenu="{StaticResource BtnFlyoutMenu}"/>
-                </StackPanel>
-            </Border>
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="SelectionChanged">
+                                    <i:InvokeCommandAction Command="{Binding SelectedFontStyleCommand}" CommandParameter="{Binding ElementName=FontTitleBox,Path=SelectedItem}"/>
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </ComboBox>
+                        <Button Width="32" Height="32" ContextMenu="{StaticResource BtnFlyoutMenu}"/>
+                    </StackPanel>
+                </Border>
 
 
 
 
-            <TextBlock x:Name="FontText"  FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,18,0,0" >Font</TextBlock>
+                <TextBlock x:Name="FontText"  FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,18,0,0" >Font</TextBlock>
 
-            <Grid Margin="0,6,0,0">
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="auto"></ColumnDefinition>
-                    <ColumnDefinition Width="auto"></ColumnDefinition>
-                </Grid.ColumnDefinitions>
-                <Grid.RowDefinitions>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
-                </Grid.RowDefinitions>
+                <Grid Margin="0,6,0,0">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="auto"></ColumnDefinition>
+                        <ColumnDefinition Width="auto"></ColumnDefinition>
+                    </Grid.ColumnDefinitions>
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="auto"></RowDefinition>
+                        <RowDefinition Height="auto"></RowDefinition>
+                        <RowDefinition Height="auto"></RowDefinition>
+                    </Grid.RowDefinitions>
 
-                <Border BorderBrush="#E2E3E6" Grid.ColumnSpan="2"  Width="228" Height="32" Margin="12,0,4,0"  BorderThickness="0">
-                    <Grid>
-                        <ComboBox IsReadOnly="True" Name="FontFamilyBox" Background="Transparent" Padding="10 10 0 0"  BorderThickness="1" BorderBrush="#FFE2E3E6"
+                    <Border BorderBrush="#E2E3E6" Grid.ColumnSpan="2"  Width="228" Height="32" Margin="12,0,4,0"  BorderThickness="0">
+                        <Grid>
+                            <ComboBox IsReadOnly="True" Name="FontFamilyBox" Background="Transparent" Padding="10 10 0 0"  BorderThickness="1" BorderBrush="#FFE2E3E6"
                                 >
-                            <ComboBox.ItemContainerStyle>
-                                <Style TargetType="{x:Type ComboBoxItem}">
-                                    <Setter Property="Padding" Value="10 0 0 0"/>
-                                </Style>
-                            </ComboBox.ItemContainerStyle>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
-                                <TextBlock Text="Courier New" FontFamily="Courier New" Tag="Courier"  FontSize="14"/>
-                            </ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
-                                <TextBlock Text="Arial" FontFamily="Arial" Tag="Helvetica" FontSize="14"/>
-                            </ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
-                                <TextBlock Text="Times New Roman" FontFamily="Times New Roman" Tag="Times Roman" FontSize="14"/>
-                            </ComboBoxItem>
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="SelectionChanged">
-                                    <i:InvokeCommandAction Command="{Binding FontFamilyChangedCommand}" CommandParameter="{Binding ElementName=FontFamilyBox,Path=SelectedIndex}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </ComboBox>
-
-                        <TextBox Name="FontFamilyText" FontFamily="Segoe UI" FontSize="14" Background="White"  Padding="10 0 0 0" Margin="2,0,25,0" IsReadOnly="True"
+                                <ComboBox.ItemContainerStyle>
+                                    <Style TargetType="{x:Type ComboBoxItem}">
+                                        <Setter Property="Padding" Value="10 0 0 0"/>
+                                    </Style>
+                                </ComboBox.ItemContainerStyle>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
+                                    <TextBlock Text="Courier New" FontFamily="Courier New" Tag="Courier"  FontSize="14"/>
+                                </ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
+                                    <TextBlock Text="Arial" FontFamily="Arial" Tag="Helvetica" FontSize="14"/>
+                                </ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
+                                    <TextBlock Text="Times New Roman" FontFamily="Times New Roman" Tag="Times Roman" FontSize="14"/>
+                                </ComboBoxItem>
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding FontFamilyChangedCommand}" CommandParameter="{Binding ElementName=FontFamilyBox,Path=SelectedIndex}"/>
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </ComboBox>
+
+                            <TextBox Name="FontFamilyText" FontFamily="Segoe UI" FontSize="14" Background="White"  Padding="10 0 0 0" Margin="2,0,25,0" IsReadOnly="True"
                              BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left">
-                        </TextBox>
-                    </Grid>
-                </Border>
+                            </TextBox>
+                        </Grid>
+                    </Border>
 
-                <cusColor:ColorSubContent x:Name="FontColorBox" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left"
+                    <cusColor:ColorSubContent x:Name="FontColorBox" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left"
                                    ></cusColor:ColorSubContent>
 
-                <Border Grid.Row="1" BorderBrush="#E2E3E6"  Width="148" Height="32" Margin="12,8,4,0"  BorderThickness="0">
-                    <Grid>
-                        <ComboBox Name="FontStyleBox" IsReadOnly="True" BorderThickness="1" BorderBrush="#FFE2E3E6" Padding="10 10 0 0" Background="Transparent">
-                            <ComboBox.ItemContainerStyle>
-                                <Style TargetType="{x:Type ComboBoxItem}">
-                                    <Setter Property="Padding" Value="10 0 0 0"/>
-                                </Style>
-                            </ComboBox.ItemContainerStyle>
-                            <ComboBoxItem x:Name="RegularItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Regular</ComboBoxItem>
-                            <ComboBoxItem x:Name="BoldItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Bold</ComboBoxItem>
-                            <ComboBoxItem x:Name="ItalicItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Italic</ComboBoxItem>
-                            <ComboBoxItem x:Name="BoldItalicItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Bold Italic</ComboBoxItem>
-
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="SelectionChanged">
-                                    <i:InvokeCommandAction Command="{Binding FontStyleChangedCommand}" CommandParameter="{Binding ElementName=FontStyleBox,Path=SelectedItem}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </ComboBox>
-                        <TextBox Name="FontStyleText" IsReadOnly="True" FontFamily="Segoe UI" FontSize="14" Background="White" Padding="10 0 0 0" Height="20" Margin="2,0,35,0" 
+                    <Border Grid.Row="1" BorderBrush="#E2E3E6"  Width="148" Height="32" Margin="12,8,4,0"  BorderThickness="0">
+                        <Grid>
+                            <ComboBox Name="FontStyleBox" IsReadOnly="True" BorderThickness="1" BorderBrush="#FFE2E3E6" Padding="10 10 0 0" Background="Transparent">
+                                <ComboBox.ItemContainerStyle>
+                                    <Style TargetType="{x:Type ComboBoxItem}">
+                                        <Setter Property="Padding" Value="10 0 0 0"/>
+                                    </Style>
+                                </ComboBox.ItemContainerStyle>
+                                <ComboBoxItem x:Name="RegularItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Regular</ComboBoxItem>
+                                <ComboBoxItem x:Name="BoldItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Bold</ComboBoxItem>
+                                <ComboBoxItem x:Name="ItalicItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Italic</ComboBoxItem>
+                                <ComboBoxItem x:Name="BoldItalicItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Bold Italic</ComboBoxItem>
+
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding FontStyleChangedCommand}" CommandParameter="{Binding ElementName=FontStyleBox,Path=SelectedItem}"/>
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </ComboBox>
+                            <TextBox Name="FontStyleText" IsReadOnly="True" FontFamily="Segoe UI" FontSize="14" Background="White" Padding="10 0 0 0" Height="20" Margin="2,0,35,0" 
                              BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left">
-                        </TextBox>
-                    </Grid>
-                </Border>
+                            </TextBox>
+                        </Grid>
+                    </Border>
 
-                <Border Grid.Row="1" Grid.Column="1" BorderBrush="#E2E3E6"  Width="80" Height="32" Margin="-1,8,0,0"  BorderThickness="0">
-                    <Grid>
-                        <ComboBox Name="FontSizeBox" BorderThickness="1" Background="Transparent" BorderBrush="#FFE2E3E6"
+                    <Border Grid.Row="1" Grid.Column="1" BorderBrush="#E2E3E6"  Width="80" Height="32" Margin="-1,8,0,0"  BorderThickness="0">
+                        <Grid>
+                            <ComboBox Name="FontSizeBox" BorderThickness="1" Background="Transparent" BorderBrush="#FFE2E3E6"
                                   MaxDropDownHeight="200">
-                            <ComboBox.ItemContainerStyle>
-                                <Style TargetType="{x:Type ComboBoxItem}">
-                                    <Setter Property="Padding" Value="10 0 0 0"/>
-                                </Style>
-                            </ComboBox.ItemContainerStyle>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">6</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">8</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">9</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">10</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">12</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">14</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">18</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">20</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">22</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">24</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">26</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">28</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">32</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">36</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">48</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">72</ComboBoxItem>
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="SelectionChanged">
-                                    <i:InvokeCommandAction Command="{Binding FontSizeChangedCommand}" CommandParameter="{Binding ElementName=FontSizeBox,Path=SelectedItem}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </ComboBox>
-                        <TextBox Name="FontSizeText" FontFamily="Segoe UI" FontSize="14" Background="White" Height="20" Padding="10 0 0 0" Margin="2,0,35,0" 
+                                <ComboBox.ItemContainerStyle>
+                                    <Style TargetType="{x:Type ComboBoxItem}">
+                                        <Setter Property="Padding" Value="10 0 0 0"/>
+                                    </Style>
+                                </ComboBox.ItemContainerStyle>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">6</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">8</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">9</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">10</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">12</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">14</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">18</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">20</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">22</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">24</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">26</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">28</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">32</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">36</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">48</ComboBoxItem>
+                                <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">72</ComboBoxItem>
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding FontSizeChangedCommand}" CommandParameter="{Binding ElementName=FontSizeBox,Path=SelectedItem}"/>
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </ComboBox>
+                            <TextBox Name="FontSizeText" FontFamily="Segoe UI" FontSize="14" Background="White" Height="20" Padding="10 0 0 0" Margin="2,0,35,0" 
                              BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" IsReadOnly="True">
-                        </TextBox>
-                    </Grid>
-                </Border>
+                            </TextBox>
+                        </Grid>
+                    </Border>
 
 
-                <Border Grid.ColumnSpan="2" Grid.Row="2" Width="148"  Margin="12,8,0,0"  HorizontalAlignment="Left">
-                    <Grid Name="ToolGrid">
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="*"></ColumnDefinition>
-                            <ColumnDefinition Width="*"></ColumnDefinition>
-                            <ColumnDefinition Width="*"></ColumnDefinition>
-                            <ColumnDefinition Width="*"></ColumnDefinition>
-                        </Grid.ColumnDefinitions>
+                    <Border Grid.ColumnSpan="2" Grid.Row="2" Width="148"  Margin="12,8,0,0"  HorizontalAlignment="Left">
+                        <Grid Name="ToolGrid">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="*"></ColumnDefinition>
+                                <ColumnDefinition Width="*"></ColumnDefinition>
+                                <ColumnDefinition Width="*"></ColumnDefinition>
+                                <ColumnDefinition Width="*"></ColumnDefinition>
+                            </Grid.ColumnDefinitions>
 
 
 
-                        <RadioButton x:Name="TextAlignLeftBtn" IsChecked="True" Tag="AlignLeft" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469"  Background="Transparent" VerticalContentAlignment="Center"
+                            <RadioButton x:Name="TextAlignLeftBtn" IsChecked="True" Tag="AlignLeft" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469"  Background="Transparent" VerticalContentAlignment="Center"
                                       Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                            <RadioButton.Content>
-                                <Grid Width="32" Height="32">
-                                    <Canvas Margin="5,10,0,0">
-                                        <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Top="4.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Top="12.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
-                                    </Canvas>
-                                </Grid>
-                            </RadioButton.Content>
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="Checked">
-                                    <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignLeftBtn,Path=Tag}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </RadioButton>
-
-                        <RadioButton x:Name="TextAlignCenterBtn" Grid.Column="1" Tag="AlignCenter" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
+                                <RadioButton.Content>
+                                    <Grid Width="32" Height="32">
+                                        <Canvas Margin="5,10,0,0">
+                                            <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Top="4.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Top="12.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
+                                        </Canvas>
+                                    </Grid>
+                                </RadioButton.Content>
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="Checked">
+                                        <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignLeftBtn,Path=Tag}"/>
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </RadioButton>
+
+                            <RadioButton x:Name="TextAlignCenterBtn" Grid.Column="1" Tag="AlignCenter" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
                                       Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                            <RadioButton.Content>
-                                <Grid Width="32" Height="32">
-                                    <Canvas Margin="5,10,0,0">
-                                        <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Left="3" Canvas.Top="4.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Left="3" Canvas.Top="12.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
-                                    </Canvas>
-                                </Grid>
-                            </RadioButton.Content>
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="Checked">
-                                    <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignCenterBtn,Path=Tag}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </RadioButton>
-
-                        <RadioButton x:Name="TextAlignRightBtn" Grid.Column="2" Tag="AlignRight" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
+                                <RadioButton.Content>
+                                    <Grid Width="32" Height="32">
+                                        <Canvas Margin="5,10,0,0">
+                                            <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Left="3" Canvas.Top="4.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Left="3" Canvas.Top="12.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
+                                        </Canvas>
+                                    </Grid>
+                                </RadioButton.Content>
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="Checked">
+                                        <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignCenterBtn,Path=Tag}"/>
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </RadioButton>
+
+                            <RadioButton x:Name="TextAlignRightBtn" Grid.Column="2" Tag="AlignRight" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
                                       Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                            <RadioButton.Content>
-                                <Grid Width="32" Height="32">
-                                    <Canvas Margin="5,10,0,0">
-                                        <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Left="6" Canvas.Top="4.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Left="6" Canvas.Top="12.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
-                                    </Canvas>
-                                </Grid>
-                            </RadioButton.Content>
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="Checked">
-                                    <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignRightBtn,Path=Tag}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </RadioButton>
-
-                        <RadioButton x:Name="TextAlignBtn" Grid.Column="3" Tag="Align" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
+                                <RadioButton.Content>
+                                    <Grid Width="32" Height="32">
+                                        <Canvas Margin="5,10,0,0">
+                                            <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Left="6" Canvas.Top="4.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Left="6" Canvas.Top="12.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
+                                        </Canvas>
+                                    </Grid>
+                                </RadioButton.Content>
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="Checked">
+                                        <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignRightBtn,Path=Tag}"/>
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </RadioButton>
+
+                            <RadioButton x:Name="TextAlignBtn" Grid.Column="3" Tag="Align" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
                                       Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                            <RadioButton.Content>
-                                <Grid Width="32" Height="32">
-                                    <Canvas Margin="5,10,0,0">
-                                        <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Top="4.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
-                                        <Rectangle Canvas.Top="12.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
-                                    </Canvas>
-                                </Grid>
-                            </RadioButton.Content>
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="Checked">
-                                    <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignBtn,Path=Tag}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </RadioButton>
+                                <RadioButton.Content>
+                                    <Grid Width="32" Height="32">
+                                        <Canvas Margin="5,10,0,0">
+                                            <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Top="4.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
+                                            <Rectangle Canvas.Top="12.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
+                                        </Canvas>
+                                    </Grid>
+                                </RadioButton.Content>
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="Checked">
+                                        <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignBtn,Path=Tag}"/>
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </RadioButton>
+
+                        </Grid>
+                    </Border>
+                </Grid>
 
+                <TextBlock x:Name="AlignText" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Align</TextBlock>
+            </StackPanel>
+
+            <StackPanel Visibility="{Binding IsTextEdit,Converter={StaticResource InvertBoolToVisibleConvert}}">
+                <TextBlock Name="AnnotTypeTitle1" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Image</TextBlock>
+                <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
+                    <Grid>
+                        <Border Name="FreeTextBorder1" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5" >
+                            <Image x:Name="ImgExmple" Source="{Binding CurrentImg}">
+                                <Image.RenderTransform>
+                                    <RotateTransform x:Name="test"  Angle="{Binding Angle}"/>
+                                </Image.RenderTransform>
+                            </Image>
+                        </Border>
                     </Grid>
                 </Border>
-            </Grid>
-
-            <TextBlock x:Name="AlignText" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
-            <Grid x:Name="LayoutAlignGrid" Width="150" HorizontalAlignment="Left" Margin="0,10,0,0">
-                <Grid.RowDefinitions>
-                    <RowDefinition Height="*"/>
-                    <RowDefinition Height="*"/>
-                </Grid.RowDefinitions>
-
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="*"/>
-                    <ColumnDefinition Width="*"/>
-                    <ColumnDefinition Width="*"/>
-                    <ColumnDefinition Width="*"/>
-                </Grid.ColumnDefinitions>
-
-                <RadioButton x:Name="BtnImgLayoutAlignLeft"  Grid.Row="0" Grid.Column="0" Tag="AlignLeft" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
+                <StackPanel Orientation="Horizontal" Margin="0,18,0,0" HorizontalAlignment="Center">
+                    <Button Margin="0,0,20,0" Content="逆转" Width="32" Height="32"
+                         IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
+                        Command="{Binding AntiClockwiseCommand}"/>
+                    <Button  Content="顺转" Width="32" Height="32" 
+                          IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
+                         Command="{Binding ClockwiseCommand}"/>
+                </StackPanel>
+
+                <CompositeControl:SlidComboControl  IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"/>
+                <StackPanel Width="228" HorizontalAlignment="Center"  Margin="0,20,0,0">
+                    <Grid x:Name="GridCrop">
+                        <cus:CustomIconToggleBtn x:Name="BtnCrop" Tag="Crop" BorderBrush="#DFE1E5" BorderThickness="1" Style="{StaticResource ToggleBtnViewModeStyle}" 
+                                             Foreground="Black" ContentStringFormat="156" 
+                                             Command="{Binding CropModeCommand}"
+                                             Visibility="{Binding IsCrop,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                                             
+                                             >
+                            <TextBlock Text="Crop"/>
+                        </cus:CustomIconToggleBtn>
+                        <Grid Visibility="{Binding IsCrop,Converter={StaticResource BoolToVisible}}">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="*"/>
+                                <ColumnDefinition Width="8"/>
+                                <ColumnDefinition Width="*"/>
+                            </Grid.ColumnDefinitions>
+
+                            <Button Content="Confirm" Background="#1770F4" Height="32" Command="{Binding CropImgCommand}"/>
+                            <Button Grid.Column="2" Content="Cancel" Background="White" BorderBrush="#DFE1E5" BorderThickness="1"
+                                Command="{Binding CancelCropCommand}"
+                                />
+                        </Grid>
+                    </Grid>
+                    <cus:CustomIconToggleBtn x:Name="BtnReplace"  Margin="0,13,0,0" Tag="Replace" BorderBrush="#DFE1E5" BorderThickness="1" Style="{StaticResource ToggleBtnViewModeStyle}" 
+                                         Foreground="Black" ContentStringFormat="156"
+                                         IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
+                                         Command="{Binding ReplaceImgCommand}"
+                                         >
+                        <TextBlock Text="Replace"/>
+                    </cus:CustomIconToggleBtn>
+
+                    <cus:CustomIconToggleBtn x:Name="BtnExtract" Margin="0,13,0,0" Tag="Extract" BorderBrush="#DFE1E5" BorderThickness="1" Style="{StaticResource ToggleBtnViewModeStyle}" 
+                                         Foreground="Black" ContentStringFormat="156"
+                                         IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
+                                         Command="{Binding ExportImgCommand}"
+                                         >
+                        <TextBlock Text="Extract"/>
+                    </cus:CustomIconToggleBtn>
+                </StackPanel>
+                <TextBlock x:Name="AlignImg" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Align</TextBlock>
+            </StackPanel>
+
+        </Grid>
+
+        <StackPanel Visibility="{Binding IsSelectTextAndImg,Converter={StaticResource BoolToVisible}}">
+            <TextBlock x:Name="GeneralProperties" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >General Properties</TextBlock>
+            <TextBlock x:Name="AlignTextAndImg" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Align</TextBlock>
+        </StackPanel>
+        
+        <Grid x:Name="LayoutAlignGrid" Grid.Row="1" Width="150" HorizontalAlignment="Left" Margin="0,10,0,0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="*"/>
+                <RowDefinition Height="*"/>
+            </Grid.RowDefinitions>
+
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="*"/>
+                <ColumnDefinition Width="*"/>
+                <ColumnDefinition Width="*"/>
+                <ColumnDefinition Width="*"/>
+            </Grid.ColumnDefinitions>
+
+            <RadioButton x:Name="BtnImgLayoutAlignLeft"  Grid.Row="0" Grid.Column="0" Tag="AlignLeft" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
                              IsEnabled="{Binding IsLayoutAlign}"       
                              Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                    <RadioButton.Content>
-                        <Path Margin="5,0,0,0" Data="M2.01367 15V1H3.51367V15H2.01367ZM5 4H11V7H5V4ZM14 9H5V12H14V9Z"
+                <RadioButton.Content>
+                    <Path Margin="5,0,0,0" Data="M2.01367 15V1H3.51367V15H2.01367ZM5 4H11V7H5V4ZM14 9H5V12H14V9Z"
                               Fill="{Binding ElementName=BtnImgLayoutAlignLeft,Path=Foreground}"/>
-                    </RadioButton.Content>
-                    <i:Interaction.Triggers>
-                        <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignLeft,Path=Tag}"/>
-                        </i:EventTrigger>
-                    </i:Interaction.Triggers>
-                </RadioButton>
-
-                <RadioButton x:Name="BtnImgLayoutAlignHorizonCenter"  Grid.Row="0" Grid.Column="1" Tag="AlignHorizonCenter" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
+                </RadioButton.Content>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignLeft,Path=Tag}"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+
+            <RadioButton x:Name="BtnImgLayoutAlignHorizonCenter"  Grid.Row="0" Grid.Column="1" Tag="AlignHorizonCenter" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
                              IsEnabled="{Binding IsLayoutAlign}"           
                              Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                    <RadioButton.Content>
-                        <Path Margin="5,0,0,0" Data="M8.75 7L8.75 9L12 9L12 12L8.75 12L8.75 15L7.25 15L7.25 12L4 12L4 9L7.25 9L7.25 7L2 7L2 4L7.25 4L7.25 0.999999L8.75 1L8.75 4L14 4L14 7L8.75 7Z" 
+                <RadioButton.Content>
+                    <Path Margin="5,0,0,0" Data="M8.75 7L8.75 9L12 9L12 12L8.75 12L8.75 15L7.25 15L7.25 12L4 12L4 9L7.25 9L7.25 7L2 7L2 4L7.25 4L7.25 0.999999L8.75 1L8.75 4L14 4L14 7L8.75 7Z" 
                             Fill="{Binding ElementName=BtnImgLayoutAlignHorizonCenter,Path=Foreground}"/>
-                    </RadioButton.Content>
-                    <i:Interaction.Triggers>
-                        <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignHorizonCenter,Path=Tag}"/>
-                        </i:EventTrigger>
-                    </i:Interaction.Triggers>
-                </RadioButton>
-
-                <RadioButton x:Name="BtnImgLayoutAlignRight"  Grid.Row="0" Grid.Column="2" Tag="AlignRight" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
+                </RadioButton.Content>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignHorizonCenter,Path=Tag}"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+
+            <RadioButton x:Name="BtnImgLayoutAlignRight"  Grid.Row="0" Grid.Column="2" Tag="AlignRight" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
                              IsEnabled="{Binding IsLayoutAlign}"            
                              Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                    <RadioButton.Content>
-                        <Path Margin="5,0,0,0" Data="M14 1L14 15L12.5 15L12.5 1L14 1ZM11 12L2 12L2 9L11 9L11 12ZM4 7L11 7L11 4L4 4L4 7Z" 
+                <RadioButton.Content>
+                    <Path Margin="5,0,0,0" Data="M14 1L14 15L12.5 15L12.5 1L14 1ZM11 12L2 12L2 9L11 9L11 12ZM4 7L11 7L11 4L4 4L4 7Z" 
                                Fill="{Binding ElementName=BtnImgLayoutAlignRight,Path=Foreground}"/>
-                    </RadioButton.Content>
-                    <i:Interaction.Triggers>
-                        <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignRight,Path=Tag}"/>
-                        </i:EventTrigger>
-                    </i:Interaction.Triggers>
-                </RadioButton>
-
-                <RadioButton x:Name="BtnImgLayoutAlignDistributeHorizontal"  Grid.Row="0" Grid.Column="3" Tag="DistributeHorizontal" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
+                </RadioButton.Content>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignRight,Path=Tag}"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+
+            <RadioButton x:Name="BtnImgLayoutAlignDistributeHorizontal"  Grid.Row="0" Grid.Column="3" Tag="DistributeHorizontal" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
                              IsEnabled="{Binding IsLayoutAvgAlign}"         
                              Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                    <RadioButton.Content>
-                        <Path Margin="5,0,0,0" Data="M15 12.5L1 12.5L1 14L15 14L15 12.5ZM12 9.5L4 9.5L4 6.5L12 6.5L12 9.5ZM1 2L15 2L15 3.5L1 3.5L1 2Z" 
+                <RadioButton.Content>
+                    <Path Margin="5,0,0,0" Data="M15 12.5L1 12.5L1 14L15 14L15 12.5ZM12 9.5L4 9.5L4 6.5L12 6.5L12 9.5ZM1 2L15 2L15 3.5L1 3.5L1 2Z" 
                               Fill="{Binding ElementName=BtnImgLayoutAlignDistributeHorizontal,Path=Foreground}"/>
-                    </RadioButton.Content>
-                    <i:Interaction.Triggers>
-                        <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignDistributeHorizontal,Path=Tag}"/>
-                        </i:EventTrigger>
-                    </i:Interaction.Triggers>
-                </RadioButton>
-
-                <RadioButton x:Name="BtnImgLayoutAlignTop"  Grid.Row="1" Grid.Column="0" Tag="AlignTop" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
+                </RadioButton.Content>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignDistributeHorizontal,Path=Tag}"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+
+            <RadioButton x:Name="BtnImgLayoutAlignTop"  Grid.Row="1" Grid.Column="0" Tag="AlignTop" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
                              IsEnabled="{Binding IsLayoutAlign}"           
                              Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                    <RadioButton.Content>
-                        <Path Margin="5,0,0,0" Data="M15 2L1 2L1 3.5L15 3.5L15 2ZM12 5L12 11L9 11L9 5L12 5ZM7 5L7 14L4 14L4 5L7 5Z"
+                <RadioButton.Content>
+                    <Path Margin="5,0,0,0" Data="M15 2L1 2L1 3.5L15 3.5L15 2ZM12 5L12 11L9 11L9 5L12 5ZM7 5L7 14L4 14L4 5L7 5Z"
                               Fill="{Binding ElementName=BtnImgLayoutAlignTop,Path=Foreground}"/>
-                    </RadioButton.Content>
-                    <i:Interaction.Triggers>
-                        <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignTop,Path=Tag}"/>
-                        </i:EventTrigger>
-                    </i:Interaction.Triggers>
-                </RadioButton>
-
-                <RadioButton x:Name="BtnImgLayoutAlignVerticalCenter"  Grid.Row="1" Grid.Column="1" Tag="AlignVerticalCenter" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
+                </RadioButton.Content>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignTop,Path=Tag}"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+
+            <RadioButton x:Name="BtnImgLayoutAlignVerticalCenter"  Grid.Row="1" Grid.Column="1" Tag="AlignVerticalCenter" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
                              IsEnabled="{Binding IsLayoutAlign}"           
                              Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                    <RadioButton.Content>
-                        <Path Margin="5,0,0,0" Data="M7 7.25L9 7.25L9 4L12 4L12 7.25L15 7.25L15 8.75L12 8.75L12 12L9 12L9 8.75L7 8.75L7 14L4 14L4 8.75L1 8.75L1 7.25L4 7.25L4 2L7 2L7 7.25Z" 
+                <RadioButton.Content>
+                    <Path Margin="5,0,0,0" Data="M7 7.25L9 7.25L9 4L12 4L12 7.25L15 7.25L15 8.75L12 8.75L12 12L9 12L9 8.75L7 8.75L7 14L4 14L4 8.75L1 8.75L1 7.25L4 7.25L4 2L7 2L7 7.25Z" 
                               Fill="{Binding ElementName=BtnImgLayoutAlignVerticalCenter,Path=Foreground}"/>
-                    </RadioButton.Content>
-                    <i:Interaction.Triggers>
-                        <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignVerticalCenter,Path=Tag}"/>
-                        </i:EventTrigger>
-                    </i:Interaction.Triggers>
-                </RadioButton>
-
-                <RadioButton x:Name="BtnImgLayoutAlignBottom"  Grid.Row="1" Grid.Column="2" Tag="AlignBottom" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
+                </RadioButton.Content>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignVerticalCenter,Path=Tag}"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+
+            <RadioButton x:Name="BtnImgLayoutAlignBottom"  Grid.Row="1" Grid.Column="2" Tag="AlignBottom" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
                              IsEnabled="{Binding IsLayoutAlign}"         
                              Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                    <RadioButton.Content>
-                        <Path Margin="5,0,0,0" Data="M9 2H12V11H9V2ZM4 5H7V11H4V5ZM1 14H15V12.5H1V14Z" 
+                <RadioButton.Content>
+                    <Path Margin="5,0,0,0" Data="M9 2H12V11H9V2ZM4 5H7V11H4V5ZM1 14H15V12.5H1V14Z" 
                               Fill="{Binding ElementName=BtnImgLayoutAlignBottom,Path=Foreground}"/>
-                    </RadioButton.Content>
-                    <i:Interaction.Triggers>
-                        <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignBottom,Path=Tag}"/>
-                        </i:EventTrigger>
-                    </i:Interaction.Triggers>
-                </RadioButton>
-
-                <RadioButton x:Name="BtnImgLayoutDistributeVertical"  Grid.Row="1" Grid.Column="3" Tag="DistributeVertical" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"     
+                </RadioButton.Content>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignBottom,Path=Tag}"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+
+            <RadioButton x:Name="BtnImgLayoutDistributeVertical"  Grid.Row="1" Grid.Column="3" Tag="DistributeVertical" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"     
                              IsEnabled="{Binding IsLayoutAvgAlign}"
                              Style="{DynamicResource GreyBgRadioBtnStyle}" >
-                    <RadioButton.Content>
-                        <Path Margin="5,0,0,0" Data="M2 15V1H3.5V15H2ZM6.5 4H9.5V12H6.5V4ZM12.5 1V15H14V1H12.5Z"
+                <RadioButton.Content>
+                    <Path Margin="5,0,0,0" Data="M2 15V1H3.5V15H2ZM6.5 4H9.5V12H6.5V4ZM12.5 1V15H14V1H12.5Z"
                               
                               Fill="{Binding ElementName=BtnImgLayoutDistributeVertical,Path=Foreground}"/>
-                    </RadioButton.Content>
-                    <i:Interaction.Triggers>
-                        <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutDistributeVertical,Path=Tag}"/>
-                        </i:EventTrigger>
-                    </i:Interaction.Triggers>
-                </RadioButton>
-
-
-            </Grid>
-
-        </StackPanel>
-
-        <StackPanel Visibility="{Binding IsTextEdit,Converter={StaticResource InvertBoolToVisibleConvert}}">
-            <TextBlock Name="AnnotTypeTitle1" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Image</TextBlock>
-            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
-                <Grid>
-                    <Border Name="FreeTextBorder1" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5" >
-                        <Image x:Name="ImgExmple" Source="{Binding CurrentImg}">
-                            <Image.RenderTransform>
-                                <RotateTransform x:Name="test"  Angle="{Binding Angle}"/>
-                            </Image.RenderTransform>
-                        </Image>
-                    </Border>
-                </Grid>
-            </Border>
-            <StackPanel Orientation="Horizontal" Margin="0,18,0,0" HorizontalAlignment="Center">
-                <Button Margin="0,0,20,0" Content="逆转" Width="32" Height="32"
-                         IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
-                        Command="{Binding AntiClockwiseCommand}"/>
-                <Button  Content="顺转" Width="32" Height="32" 
-                          IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
-                         Command="{Binding ClockwiseCommand}"/>
-            </StackPanel>
-
-            <CompositeControl:SlidComboControl  IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"/>
-            <StackPanel Width="228" HorizontalAlignment="Center"  Margin="0,20,0,0">
-                <Grid x:Name="GridCrop">
-                    <cus:CustomIconToggleBtn x:Name="BtnCrop" Tag="Crop" BorderBrush="#DFE1E5" BorderThickness="1" Style="{StaticResource ToggleBtnViewModeStyle}" 
-                                             Foreground="Black" ContentStringFormat="156" 
-                                             Command="{Binding CropModeCommand}"
-                                             Visibility="{Binding IsCrop,Converter={StaticResource InvertBoolToVisibleConvert}}"
-                                             
-                                             >
-                        <TextBlock Text="Crop"/>
-                    </cus:CustomIconToggleBtn>
-                    <Grid Visibility="{Binding IsCrop,Converter={StaticResource BoolToVisible}}">
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="*"/>
-                            <ColumnDefinition Width="8"/>
-                            <ColumnDefinition Width="*"/>
-                        </Grid.ColumnDefinitions>
-
-                        <Button Content="Confirm" Background="#1770F4" Height="32" Command="{Binding CropImgCommand}"/>
-                        <Button Grid.Column="2" Content="Cancel" Background="White" BorderBrush="#DFE1E5" BorderThickness="1"
-                                Command="{Binding CancelCropCommand}"
-                                />
-                    </Grid>
-                </Grid>
-                <cus:CustomIconToggleBtn x:Name="BtnReplace"  Margin="0,13,0,0" Tag="Replace" BorderBrush="#DFE1E5" BorderThickness="1" Style="{StaticResource ToggleBtnViewModeStyle}" 
-                                         Foreground="Black" ContentStringFormat="156"
-                                         IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
-                                         Command="{Binding ReplaceImgCommand}"
-                                         >
-                    <TextBlock Text="Replace"/>
-                </cus:CustomIconToggleBtn>
-
-                <cus:CustomIconToggleBtn x:Name="BtnExtract" Margin="0,13,0,0" Tag="Extract" BorderBrush="#DFE1E5" BorderThickness="1" Style="{StaticResource ToggleBtnViewModeStyle}" 
-                                         Foreground="Black" ContentStringFormat="156"
-                                         IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
-                                         Command="{Binding ExportImgCommand}"
-                                         >
-                    <TextBlock Text="Extract"/>
-                </cus:CustomIconToggleBtn>
-            </StackPanel>
-        </StackPanel>
+                </RadioButton.Content>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutDistributeVertical,Path=Tag}"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+
+        </Grid>
     </Grid>
 </UserControl>