Ver código fonte

Revert "综合-暂时处理:选中文字 添加矩形框 会死循环的问题"

This reverts commit b984db509fc868b9e8aa41009e4d1f3931945ba0.
lvle 1 ano atrás
pai
commit
123e5349ac

+ 0 - 4
PDF Office/App.xaml.cs

@@ -194,10 +194,6 @@ namespace PDF_Master
                 Settings.Default.UserDate = new PDFSettings.UserDate();
             }
 
-            if(Settings.Default.AppProperties==null)
-            {
-                Settings.Default.AppProperties = new PDFSettings.APPSettingProperties();
-            }
 
             if (Settings.Default.RecentOpenFiles == null)
             {

+ 5 - 0
PDF Office/CustomControl/AlertsMessage.xaml.cs

@@ -68,6 +68,7 @@ namespace PDF_Master.CustomControl
             OkBtn.Content = okBtn;
             ChbDonotAskAgain.Content = contentCheckBox;
             ChbDonotAskAgain.Visibility = Visibility.Visible;
+            Width = 408;
 
 
             if (ownerWindow != null)
@@ -88,6 +89,7 @@ namespace PDF_Master.CustomControl
             CancelBtn.Visibility = Visibility.Collapsed;
             MiddleCancelBtn.Visibility = Visibility.Collapsed;
             OkBtn.Content = okBtn;
+            Width = 408;
 
 
             this.Show();
@@ -103,6 +105,7 @@ namespace PDF_Master.CustomControl
             CancelBtn.Visibility = Visibility.Collapsed;
             MiddleCancelBtn.Content = cancelBtn;
             OkBtn.Content = okBtn;
+            Width = 408;
 
             this.Show();
         }
@@ -130,6 +133,7 @@ namespace PDF_Master.CustomControl
             CancelBtn.Visibility = Visibility.Collapsed;
             MiddleCancelBtn.Visibility = Visibility.Collapsed;
             OkBtn.Content = okBtn;
+            Width = 408;
 
             if (ownerWindow != null)
             {
@@ -146,6 +150,7 @@ namespace PDF_Master.CustomControl
             CancelBtn.Visibility = Visibility.Collapsed;
             MiddleCancelBtn.Content = cancelBtn;
             OkBtn.Content = okBtn;
+            Width = 408;
 
             ShowIcon(type);
 

+ 2 - 2
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -380,8 +380,8 @@ namespace PDF_Master.ViewModels.Tools
                     if (StrAnnotToolChecked != "Stamp" && StrAnnotToolChecked != "Freetext")
                     {
                         AnnotHandlerEventArgs annotArgs = null;
-                        //此处不能用这个方法更新创建注释的属性  会导致死循环
-                       // FindAnnotTypeKey(StrAnnotToolChecked, ref annotArgs);
+                        //propertyPanel.SaveLastAnnot();
+                        FindAnnotTypeKey(StrAnnotToolChecked, ref annotArgs);
 
                         return;
                     }

+ 170 - 375
PDF Office/Views/Dialog/SignatureCreateDialog.xaml

@@ -1,21 +1,15 @@
-<UserControl
-    x:Class="PDF_Master.Views.PropertyPanel.AnnotPanel.SignatureCreateDialog"
-    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    xmlns:annotpanel="clr-namespace:PDF_Master.ViewModels.PropertyPanel.AnnotPanel"
-    xmlns:cus="clr-namespace:PDF_Master.CustomControl"
-    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-    xmlns:dataconvert="clr-namespace:PDF_Master.DataConvert"
-    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
-    xmlns:local="clr-namespace:PDF_Master.Views.PropertyPanel.AnnotPanel"
-    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-    xmlns:prism="http://prismlibrary.com/"
-    Width="468"
-    Height="392"
-    d:DataContext="{d:DesignInstance Type=annotpanel:SignatureCreateDialogViewModel}"
-    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
-    Loaded="UserControl_Loaded"
-    mc:Ignorable="d">
+<UserControl x:Class="PDF_Master.Views.PropertyPanel.AnnotPanel.SignatureCreateDialog"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PDF_Master.Views.PropertyPanel.AnnotPanel" xmlns:cus="clr-namespace:PDF_Master.CustomControl" xmlns:annotpanel="clr-namespace:PDF_Master.ViewModels.PropertyPanel.AnnotPanel" xmlns:dataconvert="clr-namespace:PDF_Master.DataConvert" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" d:DataContext="{d:DesignInstance Type=annotpanel:SignatureCreateDialogViewModel}"
+             xmlns:prism="http://prismlibrary.com/"
+             prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+             Loaded="UserControl_Loaded"
+             Width="468"
+             Height="392"
+             mc:Ignorable="d" >
     <UserControl.Resources>
 
         <Style TargetType="{x:Type TabItem}">
@@ -24,35 +18,22 @@
             <Setter Property="BorderThickness" Value="0" />
             <Setter Property="Template" Value="{DynamicResource Segmented}" />
         </Style>
-        <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert" />
-        <dataconvert:IntAndTagToBoolMultiBinding x:Key="IntAndTagToBoolMultiBinding" />
-        <dataconvert:ListCountAndBoolToVisible x:Key="ListCountAndBoolToVisible" />
-        <dataconvert:IntToColorBrush x:Key="IntToColorBrush" />
-        <dataconvert:ListCountToVisible x:Key="ListCountToVisible" />
-        <dataconvert:CenterToolTipConverter x:Key="CenterToolTipConverter" />
-        <dataconvert:SignatureButtonConvert x:Key="SignatureButtonConvert" />
+        <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert"/>
+        <dataconvert:IntAndTagToBoolMultiBinding x:Key="IntAndTagToBoolMultiBinding"/>
+        <dataconvert:ListCountAndBoolToVisible x:Key="ListCountAndBoolToVisible"/>
+        <dataconvert:IntToColorBrush x:Key="IntToColorBrush"/>
+        <dataconvert:ListCountToVisible x:Key="ListCountToVisible"/>
+        <dataconvert:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
+        <dataconvert:SignatureButtonConvert x:Key="SignatureButtonConvert"/>
 
         <Style x:Key="TriangleToolTipStyle" TargetType="ToolTip">
             <Setter Property="Template">
                 <Setter.Value>
                     <ControlTemplate>
                         <StackPanel>
-                            <Path
-                                Margin="0,0,10,0"
-                                HorizontalAlignment="Center"
-                                VerticalAlignment="Center"
-                                Data="M 6 0 L 0 6 L 12 6 Z"
-                                Fill="#E6333333" />
-                            <Border
-                                HorizontalAlignment="Stretch"
-                                VerticalAlignment="Stretch"
-                                Background="#E6333333"
-                                CornerRadius="8">
-                                <TextBlock
-                                    Margin="6"
-                                    Foreground="White"
-                                    LineHeight="20"
-                                    Text="{TemplateBinding ContentControl.Content}" />
+                            <Path HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 6 0 L 0 6 L 12 6 Z" Fill="#E6333333" Margin="0,0,10,0"/>
+                            <Border CornerRadius="8" Background="#E6333333" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
+                                <TextBlock  Text="{TemplateBinding ContentControl.Content}" Foreground="White"  LineHeight="20" Margin="6"/>
                             </Border>
                         </StackPanel>
                     </ControlTemplate>
@@ -64,178 +45,113 @@
         <cus:DialogContent.Content>
             <TabControl
                 BorderThickness="0"
-                SelectedIndex="{Binding TabItemIndex, Mode=TwoWay}"
-                Style="{StaticResource FormTabControl}">
+                Style="{StaticResource FormTabControl }"
+                SelectedIndex="{Binding TabItemIndex,Mode=TwoWay}">
                 <TabItem x:Name="InputItem">
                     <Grid>
                         <Grid.RowDefinitions>
-                            <RowDefinition Height="*" />
-                            <RowDefinition Height="32" />
+                            <RowDefinition Height="*"/>
+                            <RowDefinition Height="32"/>
                         </Grid.RowDefinitions>
                         <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="16" />
-                            <ColumnDefinition Width="*" />
-                            <ColumnDefinition Width="16" />
+                            <ColumnDefinition Width="16"/>
+                            <ColumnDefinition Width="*"/>
+                            <ColumnDefinition Width="16"/>
                         </Grid.ColumnDefinitions>
-                        <cus:TextBoxEx
+                        <cus:TextBoxEx 
                             x:Name="InPutTextBox"
-                            Grid.Column="1"
-                            Height="182"
-                            HorizontalContentAlignment="Center"
-                            VerticalContentAlignment="Center"
-                            Background="{StaticResource color.sys.layout.mg}"
-                            FontFamily="{Binding ElementName=TextComBox, Path=SelectedValue, TargetNullValue=Segoe UI}"
-                            FontSize="20"
-                            Foreground="{Binding RadioButtonIndex, Converter={StaticResource IntToColorBrush}}"
-                            PlaceholderText="Input"
-                            ShowClose="False"
-                            Text="{Binding InputText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            TextChanged="TextBoxEx_TextChanged" />
-                        <Button
-                            x:Name="BtnTextClear"
-                            Grid.Column="1"
-                            Width="43"
-                            Height="24"
-                            Margin="0,0,8,24"
-                            HorizontalAlignment="Right"
-                            VerticalAlignment="Bottom"
-                            Command="{Binding ClearTextCommnad}"
-                            Style="{StaticResource btn.sec}"
-                            Visibility="{Binding ShowTextButton}" />
-                        <ComboBox
-                            x:Name="TextComBox"
-                            Grid.Row="1"
-                            Grid.Column="1"
-                            Width="200"
-                            HorizontalAlignment="Left"
-                            VerticalContentAlignment="Center"
-                            ItemsSource="{Binding FontNameList}"
-                            SelectedIndex="{Binding FontNameIndex, Mode=TwoWay}" />
-                        <StackPanel
-                            Grid.Row="1"
-                            Grid.Column="1"
-                            HorizontalAlignment="Right"
-                            VerticalAlignment="Center"
-                            Orientation="Horizontal">
-                            <cus:PathRadioButton
-                                Checked="TextRadioButton_Checked"
-                                CornerRadius="4"
-                                MouseDownBackground="#CED0D4"
-                                MouseDownBackgroundOpacity="0.6"
-                                MouseOverBackground="#EDEEF0"
-                                Tag="1">
+                            FontFamily="{Binding ElementName=TextComBox,Path=SelectedValue, TargetNullValue=Segoe UI}" 
+                            Background="{StaticResource color.sys.layout.mg}" Grid.Column="1" 
+                            TextChanged="TextBoxEx_TextChanged"
+                            PlaceholderText="Input"  Height="182" FontSize="20"
+                            HorizontalContentAlignment="Center" VerticalContentAlignment="Center"  
+                            ShowClose="False" Text="{Binding InputText,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
+                            Foreground ="{Binding RadioButtonIndex,Converter={StaticResource IntToColorBrush}}"  />
+                        <Button x:Name="BtnTextClear" Margin="0,0,8,24" Visibility="{Binding ShowTextButton}" Style="{StaticResource btn.sec}" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="24" Width="43" Command="{Binding ClearTextCommnad}" />
+                        <ComboBox Grid.Row="1" Grid.Column="1" x:Name="TextComBox"
+                        Width="200"
+                        HorizontalAlignment="Left"
+                        VerticalContentAlignment="Center" 
+                        ItemsSource="{Binding FontNameList}"
+                        SelectedIndex="{Binding FontNameIndex,Mode=TwoWay}"/>
+                        <StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
+                            <cus:PathRadioButton CornerRadius="4" Tag="1" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
                                 <cus:PathRadioButton.Content>
                                     <Grid Width="32" Height="32">
-                                        <Ellipse
-                                            Width="20"
-                                            Height="20"
-                                            Fill="#252629" />
+                                        <Ellipse Width="20" Height="20" Fill="#252629"/>
                                     </Grid>
                                 </cus:PathRadioButton.Content>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction
-                                            Command="{Binding CheckedCommnad}"
-                                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Tag}"
-                                            PassEventArgsToCommand="True" />
+                                        <i:InvokeCommandAction Command="{Binding CheckedCommnad}" 
+                                                               CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
+                                                               PassEventArgsToCommand="True" />
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                                 <RadioButton.IsChecked>
-                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding}" Mode="OneWay">
-                                        <Binding Source="1" />
-                                        <Binding Path="RadioButtonIndex" />
+                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
+                                        <Binding Source="1"/>
+                                        <Binding Path="RadioButtonIndex"/>
                                     </MultiBinding>
                                 </RadioButton.IsChecked>
                             </cus:PathRadioButton>
-                            <cus:PathRadioButton
-                                Margin="11,0"
-                                Checked="TextRadioButton_Checked"
-                                CornerRadius="4"
-                                MouseDownBackground="#CED0D4"
-                                MouseDownBackgroundOpacity="0.6"
-                                MouseOverBackground="#EDEEF0"
-                                Tag="2">
+                            <cus:PathRadioButton Tag="2" CornerRadius="4" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
                                 <cus:PathRadioButton.Content>
                                     <Grid Width="32" Height="32">
-                                        <Ellipse
-                                            Width="20"
-                                            Height="20"
-                                            Fill="#F3465B" />
+                                        <Ellipse Width="20" Height="20"   Fill="#F3465B"/>
                                     </Grid>
                                 </cus:PathRadioButton.Content>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction
-                                            Command="{Binding CheckedCommnad}"
-                                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Tag}"
-                                            PassEventArgsToCommand="True" />
+                                        <i:InvokeCommandAction Command="{Binding CheckedCommnad}" 
+                                                               CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
+                                                               PassEventArgsToCommand="True" />
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                                 <RadioButton.IsChecked>
-                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding}" Mode="OneWay">
-                                        <Binding Source="2" />
-                                        <Binding Path="RadioButtonIndex" />
+                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
+                                        <Binding Source="2"/>
+                                        <Binding Path="RadioButtonIndex"/>
                                     </MultiBinding>
                                 </RadioButton.IsChecked>
                             </cus:PathRadioButton>
-                            <cus:PathRadioButton
-                                Checked="TextRadioButton_Checked"
-                                CornerRadius="4"
-                                MouseDownBackground="#CED0D4"
-                                MouseDownBackgroundOpacity="0.6"
-                                MouseOverBackground="#EDEEF0"
-                                Tag="3">
+                            <cus:PathRadioButton Tag="3" CornerRadius="4" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
                                 <cus:PathRadioButton.Content>
                                     <Grid Width="32" Height="32">
-                                        <Ellipse
-                                            Width="20"
-                                            Height="20"
-                                            Fill="#273C62" />
+                                        <Ellipse Width="20" Height="20"   Fill="#273C62"/>
                                     </Grid>
                                 </cus:PathRadioButton.Content>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction
-                                            Command="{Binding CheckedCommnad}"
-                                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Tag}"
-                                            PassEventArgsToCommand="True" />
+                                        <i:InvokeCommandAction Command="{Binding CheckedCommnad}" 
+                                                               CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
+                                                               PassEventArgsToCommand="True" />
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                                 <RadioButton.IsChecked>
-                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding}" Mode="OneWay">
-                                        <Binding Source="3" />
-                                        <Binding Path="RadioButtonIndex" />
+                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
+                                        <Binding Source="3"/>
+                                        <Binding Path="RadioButtonIndex"/>
                                     </MultiBinding>
                                 </RadioButton.IsChecked>
                             </cus:PathRadioButton>
-                            <cus:PathRadioButton
-                                Margin="11,0,0,0"
-                                Checked="TextRadioButton_Checked"
-                                CornerRadius="4"
-                                MouseDownBackground="#CED0D4"
-                                MouseDownBackgroundOpacity="0.6"
-                                MouseOverBackground="#EDEEF0"
-                                Tag="4">
+                            <cus:PathRadioButton Tag="4" CornerRadius="4" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
                                 <cus:PathRadioButton.Content>
                                     <Grid Width="32" Height="32">
-                                        <Ellipse
-                                            Width="20"
-                                            Height="20"
-                                            Fill="#94989C" />
+                                        <Ellipse Width="20" Height="20"   Fill="#94989C"/>
                                     </Grid>
                                 </cus:PathRadioButton.Content>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction
-                                            Command="{Binding CheckedCommnad}"
-                                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Tag}"
-                                            PassEventArgsToCommand="True" />
+                                        <i:InvokeCommandAction Command="{Binding CheckedCommnad}" 
+                                                               CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
+                                                               PassEventArgsToCommand="True" />
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                                 <RadioButton.IsChecked>
-                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding}" Mode="OneWay">
-                                        <Binding Source="4" />
-                                        <Binding Path="RadioButtonIndex" />
+                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
+                                        <Binding Source="4"/>
+                                        <Binding Path="RadioButtonIndex"/>
                                     </MultiBinding>
                                 </RadioButton.IsChecked>
                             </cus:PathRadioButton>
@@ -245,185 +161,115 @@
                 <TabItem x:Name="DrawItem">
                     <Grid>
                         <Grid.RowDefinitions>
-                            <RowDefinition Height="*" />
-                            <RowDefinition Height="32" />
+                            <RowDefinition Height="*"/>
+                            <RowDefinition Height="32"/>
                         </Grid.RowDefinitions>
 
                         <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="16" />
-                            <ColumnDefinition Width="*" />
-                            <ColumnDefinition Width="16" />
+                            <ColumnDefinition Width="16"/>
+                            <ColumnDefinition Width="*"/>
+                            <ColumnDefinition Width="16"/>
                         </Grid.ColumnDefinitions>
-                        <Border
-                            Grid.Column="1"
-                            Height="182"
-                            BorderBrush="{StaticResource color.field.border.norm}"
-                            BorderThickness="1"
-                            CornerRadius="4">
+                        <Border Grid.Column="1"  Height="182" BorderThickness="1" CornerRadius="4" BorderBrush="{StaticResource color.field.border.norm}">
                             <Grid>
-                                <InkCanvas
-                                    x:Name="inkCanvas"
-                                    Background="{StaticResource color.sys.layout.mg}"
-                                    DefaultDrawingAttributes="{Binding DrawingAttributeObject}"
-                                    PreviewMouseLeftButtonDown="inkCanvas_MouseLeftButtonDown"
-                                    PreviewMouseLeftButtonUp="inkCanvas_MouseLeftButtonUp"
-                                    Strokes="{Binding StrokesObject}" />
+                                <InkCanvas x:Name="inkCanvas" PreviewMouseLeftButtonDown="inkCanvas_MouseLeftButtonDown"  PreviewMouseLeftButtonUp="inkCanvas_MouseLeftButtonUp"  DefaultDrawingAttributes="{Binding DrawingAttributeObject}" Strokes="{Binding StrokesObject}"/>
 
-                                <Grid
-                                    x:Name="PlanGrid"
-                                    Background="{StaticResource color.sys.layout.mg}"
-                                    IsHitTestVisible="False"
-                                    Opacity="0.7">
+                                <Grid Opacity="0.7" x:Name="PlanGrid"   IsHitTestVisible="False" Background="#F3F3F3">
                                     <Grid.Visibility>
-                                        <MultiBinding Converter="{StaticResource ListCountAndBoolToVisible}" Mode="OneWay">
-                                            <Binding Path="StrokesObject.Count" />
-                                            <Binding Path="IsMouseDown" />
+                                        <MultiBinding Converter="{StaticResource ListCountAndBoolToVisible }" Mode="OneWay">
+                                            <Binding Path="StrokesObject.Count"/>
+                                            <Binding Path="IsMouseDown"/>
                                         </MultiBinding>
                                     </Grid.Visibility>
-                                    <TextBlock
-                                        x:Name="DrawHint"
-                                        HorizontalAlignment="Center"
-                                        VerticalAlignment="Center" />
+                                    <TextBlock x:Name="DrawHint" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                 </Grid>
-                                <Button
-                                    x:Name="BtnDrawClear"
-                                    Width="43"
-                                    Height="24"
-                                    Margin="0,0,8,8"
-                                    HorizontalAlignment="Right"
-                                    VerticalAlignment="Bottom"
-                                    Command="{Binding ClearInkCanvasCommnad}"
-                                    Style="{StaticResource btn.sec}"
-                                    Visibility="{Binding ElementName=PlanGrid, Path=Visibility, Converter={StaticResource UnVisivleConvert}}" />
+                                <Button x:Name="BtnDrawClear" Style="{StaticResource btn.sec}" Margin="0,0,8,8" Width="43" Height="24" HorizontalAlignment="Right" VerticalAlignment="Bottom" Command="{Binding ClearInkCanvasCommnad}" Visibility="{Binding ElementName=PlanGrid,Path=Visibility,Converter={StaticResource UnVisivleConvert}}"/>
                             </Grid>
                         </Border>
-                        <ComboBox
-                            Grid.Row="1"
-                            Grid.Column="1"
-                            Width="80"
-                            HorizontalAlignment="Left"
-                            VerticalContentAlignment="Center"
-                            ItemsSource="{Binding ThicknessList}"
-                            SelectedIndex="{Binding ThicknessListIndex, Mode=TwoWay}" />
-                        <StackPanel
-                            Grid.Row="1"
-                            Grid.Column="1"
-                            HorizontalAlignment="Right"
-                            VerticalAlignment="Center"
-                            Orientation="Horizontal">
-                            <cus:PathRadioButton
-                                Checked="ImageRadioButton_Checked"
-                                MouseDownBackground="#CED0D4"
-                                MouseDownBackgroundOpacity="0.6"
-                                MouseOverBackground="#EDEEF0"
-                                Tag="1">
+                        <ComboBox Grid.Row="1" Grid.Column="1" 
+                        Width="80"
+                        HorizontalAlignment="Left"
+                        VerticalContentAlignment="Center" 
+                        ItemsSource="{Binding ThicknessList}"
+                        SelectedIndex="{Binding ThicknessListIndex,Mode=TwoWay}"/>
+                        <StackPanel Grid.Row="1" Grid.Column="1"  HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal" >
+                            <cus:PathRadioButton Tag="1" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
                                 <cus:PathRadioButton.Content>
                                     <Grid Width="32" Height="32">
-                                        <Ellipse
-                                            Width="20"
-                                            Height="20"
-                                            Fill="#252629" />
+                                        <Ellipse Width="20" Height="20" Fill="#252629"/>
                                     </Grid>
                                 </cus:PathRadioButton.Content>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction
-                                            Command="{Binding CheckedCommnad}"
-                                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Tag}"
-                                            PassEventArgsToCommand="True" />
+                                        <i:InvokeCommandAction Command="{Binding CheckedCommnad}" 
+                                                               CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
+                                                               PassEventArgsToCommand="True" />
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                                 <RadioButton.IsChecked>
-                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding}" Mode="OneWay">
-                                        <Binding Source="1" />
-                                        <Binding Path="ImageRadioButtonIndex" />
+                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
+                                        <Binding Source="1"/>
+                                        <Binding Path="ImageRadioButtonIndex"/>
                                     </MultiBinding>
                                 </RadioButton.IsChecked>
                             </cus:PathRadioButton>
-                            <cus:PathRadioButton
-                                Checked="ImageRadioButton_Checked"
-                                MouseDownBackground="#CED0D4"
-                                MouseDownBackgroundOpacity="0.6"
-                                MouseOverBackground="#EDEEF0"
-                                Tag="2">
+                            <cus:PathRadioButton Tag="2" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
                                 <cus:PathRadioButton.Content>
                                     <Grid Width="32" Height="32">
-                                        <Ellipse
-                                            Width="20"
-                                            Height="20"
-                                            Fill="#FC1F1F" />
+                                        <Ellipse Width="20" Height="20"   Fill="#FC1F1F"/>
                                     </Grid>
                                 </cus:PathRadioButton.Content>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction
-                                            Command="{Binding CheckedCommnad}"
-                                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Tag}"
-                                            PassEventArgsToCommand="True" />
+                                        <i:InvokeCommandAction Command="{Binding CheckedCommnad}" 
+                                                               CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
+                                                               PassEventArgsToCommand="True" />
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                                 <RadioButton.IsChecked>
-                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding}" Mode="OneWay">
-                                        <Binding Source="2" />
-                                        <Binding Path="ImageRadioButtonIndex" />
+                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
+                                        <Binding Source="2"/>
+                                        <Binding Path="ImageRadioButtonIndex"/>
                                     </MultiBinding>
                                 </RadioButton.IsChecked>
                             </cus:PathRadioButton>
-                            <cus:PathRadioButton
-                                Checked="ImageRadioButton_Checked"
-                                MouseDownBackground="#CED0D4"
-                                MouseDownBackgroundOpacity="0.6"
-                                MouseOverBackground="#EDEEF0"
-                                Tag="3">
+                            <cus:PathRadioButton Tag="3" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
                                 <cus:PathRadioButton.Content>
                                     <Grid Width="32" Height="32">
-                                        <Ellipse
-                                            Width="20"
-                                            Height="20"
-                                            Fill="#273C62" />
+                                        <Ellipse Width="20" Height="20" Fill="#273C62"/>
                                     </Grid>
                                 </cus:PathRadioButton.Content>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction
-                                            Command="{Binding CheckedCommnad}"
-                                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Tag}"
-                                            PassEventArgsToCommand="True" />
+                                        <i:InvokeCommandAction Command="{Binding CheckedCommnad}" 
+                                                               CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
+                                                               PassEventArgsToCommand="True" />
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                                 <RadioButton.IsChecked>
-                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding}" Mode="OneWay">
-                                        <Binding Source="3" />
-                                        <Binding Path="ImageRadioButtonIndex" />
+                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
+                                        <Binding Source="3"/>
+                                        <Binding Path="ImageRadioButtonIndex"/>
                                     </MultiBinding>
                                 </RadioButton.IsChecked>
                             </cus:PathRadioButton>
-                            <cus:PathRadioButton
-                                Checked="ImageRadioButton_Checked"
-                                MouseDownBackground="#CED0D4"
-                                MouseDownBackgroundOpacity="0.6"
-                                MouseOverBackground="#EDEEF0"
-                                Tag="4">
+                            <cus:PathRadioButton Tag="4" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
                                 <cus:PathRadioButton.Content>
                                     <Grid Width="32" Height="32">
-                                        <Ellipse
-                                            Width="20"
-                                            Height="20"
-                                            Fill="#94989C" />
+                                        <Ellipse Width="20" Height="20" Fill="#94989C"/>
                                     </Grid>
                                 </cus:PathRadioButton.Content>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction
-                                            Command="{Binding CheckedCommnad}"
-                                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Tag}"
-                                            PassEventArgsToCommand="True" />
+                                        <i:InvokeCommandAction Command="{Binding CheckedCommnad}" 
+                                                               CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
+                                                               PassEventArgsToCommand="True" />
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                                 <RadioButton.IsChecked>
-                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding}" Mode="OneWay">
-                                        <Binding Source="4" />
-                                        <Binding Path="ImageRadioButtonIndex" />
+                                    <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
+                                        <Binding Source="4"/>
+                                        <Binding Path="ImageRadioButtonIndex"/>
                                     </MultiBinding>
                                 </RadioButton.IsChecked>
                             </cus:PathRadioButton>
@@ -433,101 +279,50 @@
                 <TabItem x:Name="PictureItem">
                     <Grid>
                         <Grid.RowDefinitions>
-                            <RowDefinition Height="*" />
-                            <RowDefinition Height="32" />
+                            <RowDefinition Height="*"/>
+                            <RowDefinition Height="32"/>
                         </Grid.RowDefinitions>
 
                         <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="16" />
-                            <ColumnDefinition Width="*" />
-                            <ColumnDefinition Width="16" />
+                            <ColumnDefinition Width="16"/>
+                            <ColumnDefinition Width="*"/>
+                            <ColumnDefinition Width="16"/>
                         </Grid.ColumnDefinitions>
-                        <Border
-                            Grid.Column="1"
-                            Height="182"
-                            BorderBrush="{StaticResource color.field.border.norm}"
-                            BorderThickness="1"
-                            CornerRadius="4">
+                        <Border Grid.Column="1"  Height="182" BorderThickness="1" CornerRadius="4" BorderBrush="{StaticResource color.field.border.norm}">
                             <Grid Background="{StaticResource color.sys.layout.mg}">
-                                <StackPanel
-                                    x:Name="AddStackPanel"
-                                    HorizontalAlignment="Center"
-                                    VerticalAlignment="Center"
-                                    Visibility="{Binding ShowImageButton}">
+                                <StackPanel  x:Name="AddStackPanel"  HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding ShowImageButton}">
                                     <cus:ImageButton
-                                        Width="128"
-                                        Height="128"
-                                        Command="{Binding OpenImageCommnad}"
-                                        Icon="pack://application:,,,/PDF Master;component/Resources/Dialog/AddImage.png"
-                                        IconHeight="128"
-                                        IconMouseOver="pack://application:,,,/PDF Master;component/Resources/Dialog/AddImageSuspend.png"
-                                        IconPress="pack://application:,,,/PDF Master;component/Resources/Dialog/AddImageSuspend.png"
-                                        IconWidth="128" />
-                                    <TextBlock
-                                        x:Name="ImageHint"
-                                        HorizontalAlignment="Center"
-                                        VerticalAlignment="Center"
-                                        FontFamily="Segoe UI"
-                                        FontSize="14"
-                                        FontWeight="Regular"
-                                        Foreground="{StaticResource color.sys.text.neutral.lv3}" />
+                                Height="128" Width="128" IconHeight="128" IconWidth="128"  
+                                Icon="pack://application:,,,/PDF Master;component/Resources/Dialog/AddImage.png"  
+                                IconPress="pack://application:,,,/PDF Master;component/Resources/Dialog/AddImageSuspend.png"  
+                                IconMouseOver="pack://application:,,,/PDF Master;component/Resources/Dialog/AddImageSuspend.png"   
+                                Command="{Binding OpenImageCommnad}"/>
+                                    <TextBlock x:Name="ImageHint" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource color.sys.text.neutral.lv3}"/>
                                 </StackPanel>
-                                <Grid Visibility="{Binding ElementName=AddStackPanel, Path=Visibility, Converter={StaticResource UnVisivleConvert}}">
+                                <Grid Visibility="{Binding ElementName=AddStackPanel,Path=Visibility,Converter={StaticResource UnVisivleConvert}}">
                                     <Grid.RowDefinitions>
-                                        <RowDefinition Height="24" />
-                                        <RowDefinition Height="*" />
+                                        <RowDefinition Height="24"/>
+                                        <RowDefinition Height="*"/>
                                     </Grid.RowDefinitions>
-                                    <Image
-                                        Grid.RowSpan="2"
-                                        Width="200"
-                                        Height="200"
-                                        Source="{Binding ImagePreviewSource}" />
-                                    <Button
-                                        x:Name="BtnPictureReselect"
-                                        Grid.Row="1"
-                                        Width="60"
-                                        Height="24"
-                                        Margin="0,0,8,8"
-                                        HorizontalAlignment="Right"
-                                        VerticalAlignment="Bottom"
-                                        Command="{Binding OpenImageCommnad}"
-                                        Style="{StaticResource btn.sec}" />
+                                    <Image Grid.RowSpan="2" Width="200" Height="200" Source="{Binding ImagePreviewSource}" />
+                                    <Button x:Name="BtnPictureReselect" Style="{StaticResource btn.sec}" Grid.Row="1" Width="60" Height="24" Margin="0,0,8,8" HorizontalAlignment="Right" VerticalAlignment="Bottom" Command="{Binding OpenImageCommnad}"/>
                                 </Grid>
                             </Grid>
                         </Border>
-                        <StackPanel
-                            Grid.Row="1"
-                            Grid.Column="1"
-                            HorizontalAlignment="Center"
-                            Orientation="Horizontal">
-                            <CheckBox
-                                Width="20"
-                                Height="20"
-                                IsChecked="{Binding IsRemoveBackground}" />
-                            <TextBlock
-                                x:Name="BtnReBkg"
-                                HorizontalAlignment="Center"
-                                VerticalAlignment="Center"
-                                FontFamily="Segoe UI"
-                                FontSize="14" />
-                            <cus:ImageButton
-                                Width="16"
-                                Height="16"
-                                Margin="8,0,0,0"
-                                Icon="pack://application:,,,/PDF Master;component/Resources/Dialog/help.png"
-                                IconHeight="16"
-                                IconMouseOver="pack://application:,,,/PDF Master;component/Resources/Dialog/helphover.png"
-                                IconPress="pack://application:,,,/PDF Master;component/Resources/Dialog/help.png"
-                                IconWidth="16">
-                                <cus:ImageButton.ToolTip>
-                                    <ToolTip
-                                        x:Name="BtnReBkgHint"
-                                        Placement="Bottom"
-                                        Style="{StaticResource TriangleToolTipStyle}">
+                        <StackPanel Grid.Column="1"   Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
+                            <CheckBox Width="20" Height="20" IsChecked="{Binding IsRemoveBackground}"/>
+                            <TextBlock x:Name="BtnReBkg" FontSize="14" FontFamily="Segoe UI" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                            <cus:ImageButton Margin="8,0,0,0"
+                                Height="16" Width="16" IconHeight="16" IconWidth="16"  
+                                Icon="pack://application:,,,/PDF Master;component/Resources/Dialog/help.png"  
+                                IconPress="pack://application:,,,/PDF Master;component/Resources/Dialog/help.png"  
+                                IconMouseOver="pack://application:,,,/PDF Master;component/Resources/Dialog/helphover.png">
+                                <cus:ImageButton.ToolTip >
+                                    <ToolTip Style ="{StaticResource TriangleToolTipStyle}" x:Name="BtnReBkgHint" Placement="Bottom" >
                                         <ToolTip.HorizontalOffset>
                                             <MultiBinding Converter="{StaticResource CenterToolTipConverter}">
-                                                <Binding Path="PlacementTarget.ActualWidth" RelativeSource="{RelativeSource Self}" />
-                                                <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
+                                                <Binding RelativeSource="{RelativeSource Self}" Path="PlacementTarget.ActualWidth"/>
+                                                <Binding RelativeSource="{RelativeSource Self}" Path="ActualWidth"/>
                                             </MultiBinding>
                                         </ToolTip.HorizontalOffset>
                                     </ToolTip>
@@ -540,33 +335,33 @@
         </cus:DialogContent.Content>
 
         <cus:DialogContent.BottmBar>
-            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
+            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                 <Button
                     x:Name="BtnOK"
+                    Style="{StaticResource Btn.cta}"
                     Grid.Column="0"
                     Width="80"
                     Height="32"
                     HorizontalAlignment="Right"
-                    Command="{Binding CreateCommnad}"
-                    Style="{StaticResource Btn.cta}">
+                    Command="{Binding CreateCommnad}">
                     <Button.IsEnabled>
-                        <MultiBinding Converter="{StaticResource SignatureButtonConvert}" Mode="OneWay">
-                            <Binding Path="TabItemIndex" />
-                            <Binding Path="InputText" />
-                            <Binding Path="StrokesObject.Count" />
-                            <Binding Path="ImagePreviewSource" />
+                        <MultiBinding Converter="{StaticResource SignatureButtonConvert }" Mode="OneWay">
+                            <Binding Path="TabItemIndex"/>
+                            <Binding Path="InputText"/>
+                            <Binding Path="StrokesObject.Count"/>
+                            <Binding Path="ImagePreviewSource"/>
                         </MultiBinding>
                     </Button.IsEnabled>
                 </Button>
                 <Button
-                    x:Name="BtnNo"
+                   x:Name="BtnNo"
+                    Style="{StaticResource btn.sec}"
                     Grid.Column="2"
                     Width="80"
                     Height="32"
                     Margin="16,0,16,0"
                     HorizontalAlignment="Left"
-                    Command="{Binding CancelCommand}"
-                    Style="{StaticResource btn.sec}" />
+                    Command="{Binding CancelCommand}"/>
             </StackPanel>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>

+ 1 - 1
PDF Office/Views/PageEdit/PageEditContent.xaml

@@ -359,7 +359,7 @@
                 VirtualizingPanel.CacheLength="1"
                 VirtualizingPanel.CacheLengthUnit="Page"
                 VirtualizingPanel.ScrollUnit="Pixel"
-                VirtualizingPanel.VirtualizationMode="Recycling">
+                VirtualizingPanel.VirtualizationMode="Standard">
                 <!--
                     此处要用循环模式,否则滚动时容易误触发EndSscroll 从而频繁拿图导致卡顿
                     VirtualizingPanel.ScrollUnit="Pixel" 设置鼠标每次滚动的步进值