Jelajahi Sumber

Merge branch 'dev' into practice2

# Conflicts:
#	PDF Office/Styles/ContextMenuTextEditStyle.xaml
OYXH\oyxh 2 tahun lalu
induk
melakukan
ca18349cb0
59 mengubah file dengan 2896 tambahan dan 496 penghapusan
  1. 164 4
      PDF Office/App.xaml
  2. 8 1
      PDF Office/App.xaml.cs
  3. TEMPAT SAMPAH
      PDF Office/ComPDFKit.Viewer.dll
  4. 16 0
      PDF Office/CustomControl/Form/FormFieldCombox.xaml
  5. 83 0
      PDF Office/CustomControl/Form/FormFieldCombox.xaml.cs
  6. 71 0
      PDF Office/CustomControl/MenuItemWithPath.cs
  7. 90 0
      PDF Office/CustomControl/TextBoxEx.cs
  8. 14 5
      PDF Office/Helper/CacheFilePath.cs
  9. 120 40
      PDF Office/Helper/PDFToolsHelper.cs
  10. 31 0
      PDF Office/Model/From/FormFieldType.cs
  11. 27 18
      PDF Office/Model/PDFTool/ToolItem.cs
  12. 67 1
      PDF Office/PDF Office.csproj
  13. 0 28
      PDF Office/Settings.cs
  14. 40 2
      PDF Office/Styles/ButtonStyle.xaml
  15. 53 0
      PDF Office/Styles/ContextMenuStyle.xaml
  16. 117 168
      PDF Office/Styles/ContextMenuTextEditStyle.xaml
  17. 1 1
      PDF Office/Styles/RadioButtonStyle.xaml
  18. 319 0
      PDF Office/Styles/TabControlStyle.xaml
  19. 8 0
      PDF Office/Styles/TextBoxStyle.xaml
  20. 238 0
      PDF Office/Themes/Generic.xaml
  21. 284 4
      PDF Office/ViewModels/BOTA/OutLineControlViewModel.cs
  22. 67 2
      PDF Office/ViewModels/Form/FormsToolContentViewModel.cs
  23. 14 0
      PDF Office/ViewModels/HomePanel/PDFTools/PDFToolsContentViewModel.cs
  24. 3 2
      PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs
  25. 36 0
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SignatureAnnotPropertyViewModel.cs
  26. 1 0
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/StampAnnotPropertyViewModel.cs
  27. 163 82
      PDF Office/ViewModels/PropertyPanel/TextEditPropertyViewModel.cs
  28. 6 0
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  29. 72 2
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  30. 8 7
      PDF Office/ViewModels/Tools/TextEditToolContentViewModel.cs
  31. 5 9
      PDF Office/ViewModels/ViewContentViewModel.cs
  32. 4 1
      PDF Office/Views/BOTA/BOTAContent.xaml
  33. 10 8
      PDF Office/Views/BOTA/OutLineControl.xaml
  34. 55 3
      PDF Office/Views/BOTA/OutLineControl.xaml.cs
  35. 12 0
      PDF Office/Views/Form/ButtonProperty.xaml
  36. 28 0
      PDF Office/Views/Form/ButtonProperty.xaml.cs
  37. 12 0
      PDF Office/Views/Form/CheckBoxProperty.xaml
  38. 28 0
      PDF Office/Views/Form/CheckBoxProperty.xaml.cs
  39. 12 0
      PDF Office/Views/Form/ComboxProperty.xaml
  40. 28 0
      PDF Office/Views/Form/ComboxProperty.xaml.cs
  41. 60 7
      PDF Office/Views/Form/FormsToolContent.xaml
  42. 23 0
      PDF Office/Views/Form/FormsToolContent.xaml.cs
  43. 12 0
      PDF Office/Views/Form/ListBoxProperty.xaml
  44. 28 0
      PDF Office/Views/Form/ListBoxProperty.xaml.cs
  45. 12 0
      PDF Office/Views/Form/RadioButtonProperty.xaml
  46. 28 0
      PDF Office/Views/Form/RadioButtonProperty.xaml.cs
  47. 12 0
      PDF Office/Views/Form/SignProperty.xaml
  48. 28 0
      PDF Office/Views/Form/SignProperty.xaml.cs
  49. 150 0
      PDF Office/Views/Form/TextFieldProperty.xaml
  50. 28 0
      PDF Office/Views/Form/TextFieldProperty.xaml.cs
  51. 3 3
      PDF Office/Views/HomePanel/PDFTools/PDFToolExpendItem.xaml
  52. 2 2
      PDF Office/Views/HomePanel/PDFTools/PDFToolItem.xaml
  53. 42 2
      PDF Office/Views/HomePanel/PDFTools/PDFToolsContent.xaml
  54. 27 10
      PDF Office/Views/HomePanel/PDFTools/PDFToolsContent.xaml.cs
  55. 13 0
      PDF Office/Views/PropertyPanel/AnnotPanel/SignatureAnnotProperty.xaml
  56. 28 0
      PDF Office/Views/PropertyPanel/AnnotPanel/SignatureAnnotProperty.xaml.cs
  57. 40 32
      PDF Office/Views/PropertyPanel/TextEditProperty.xaml
  58. 29 1
      PDF Office/Views/PropertyPanel/TextEditProperty.xaml.cs
  59. 16 51
      PDFSettings/PDFToolsList.cs

+ 164 - 4
PDF Office/App.xaml

@@ -11,6 +11,7 @@
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Global.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/TabControlStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ButtonStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/TextBoxStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ComboxStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ListBoxStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/WindowsStyle.xaml" />
@@ -19,6 +20,7 @@
 
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/PathButtonStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContextMenuTextEditStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContextMenuStyle.xaml" />
                 <!--  Enable show customctrol's correctly UI in Xaml Designer  -->
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Generic.xaml" />
             </ResourceDictionary.MergedDictionaries>
@@ -41,10 +43,12 @@
                 </Style.Triggers>
             </Style>
 
+            <!--  Design Token Menu Without Icon  -->
             <Style TargetType="{x:Type MenuItem}">
                 <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
-                <Setter Property="Background" Value="{StaticResource color.sys.layout.anti}" />
+                <Setter Property="Background" Value="Transparent" />
                 <Setter Property="Height" Value="32" />
+                <Setter Property="Margin" Value="8,0" />
                 <Setter Property="Template">
                     <Setter.Value>
                         <ControlTemplate TargetType="{x:Type MenuItem}">
@@ -53,7 +57,7 @@
                                 Background="{TemplateBinding Background}"
                                 BorderBrush="{TemplateBinding BorderBrush}"
                                 BorderThickness="0"
-                                CornerRadius="4">
+                                CornerRadius="7">
                                 <Grid>
                                     <Grid.ColumnDefinitions>
                                         <ColumnDefinition
@@ -75,7 +79,7 @@
                                         Grid.Column="0"
                                         Margin="5,0"
                                         VerticalAlignment="Center"
-                                        Visibility="Hidden">
+                                        Visibility="Collapsed">
                                         <Viewbox
                                             Width="18"
                                             Height="18"
@@ -143,7 +147,8 @@
                                     <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
                                 </Trigger>
                                 <Trigger Property="IsHighlighted" Value="true">
-                                    <Setter TargetName="Border" Property="Background" Value="#373737" />
+                                    <Setter TargetName="Border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
+                                    <Setter Property="Foreground" Value="{StaticResource color.sys.text.accent.norm}" />
                                 </Trigger>
                                 <MultiTrigger>
                                     <MultiTrigger.Conditions>
@@ -181,6 +186,161 @@
                     </Setter.Value>
                 </Setter>
             </Style>
+
+            <!--  Design Token ContextMenu  -->
+            <Style TargetType="{x:Type ContextMenu}">
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type ContextMenu}">
+                            <!--  Here is where you change the border thickness to zero on the menu  -->
+                            <Border Width="{TemplateBinding Width}" Padding="5">
+                                <Border.Effect>
+                                    <DropShadowEffect
+                                        BlurRadius="5"
+                                        Direction="0"
+                                        Opacity="0.16"
+                                        ShadowDepth="0"
+                                        Color="#000000" />
+                                </Border.Effect>
+                                <Border
+                                    x:Name="Border"
+                                    Padding="0,5"
+                                    CornerRadius="5">
+                                    <StackPanel
+                                        ClipToBounds="True"
+                                        IsItemsHost="True"
+                                        KeyboardNavigation.DirectionalNavigation="Cycle"
+                                        Orientation="Vertical" />
+                                </Border>
+                            </Border>
+                            <ControlTemplate.Triggers>
+                                <Trigger Property="IsMouseOver" Value="true">
+                                    <Setter TargetName="Border" Property="Background" Value="#ffffff" />
+                                </Trigger>
+                            </ControlTemplate.Triggers>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
+
+            <!--  Design Token CheckBox  -->
+
+            <Style TargetType="{x:Type CheckBox}">
+                <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+                <Setter Property="Background" Value="{StaticResource color.icon.checkbox-radio.norm.bg}" />
+                <Setter Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.norm.border}" />
+                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+                <Setter Property="BorderThickness" Value="1" />
+                <Setter Property="FontFamily" Value="Segoe UI" />
+                <Setter Property="FontSize" Value="14" />
+                <Setter Property="VerticalContentAlignment" Value="Center" />
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type CheckBox}">
+                            <Grid
+                                x:Name="templateRoot"
+                                Background="Transparent"
+                                SnapsToDevicePixels="True">
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="Auto" />
+                                    <ColumnDefinition Width="*" />
+                                </Grid.ColumnDefinitions>
+                                <Border
+                                    x:Name="checkBoxBorder"
+                                    Width="14"
+                                    Height="14"
+                                    Margin="1"
+                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                    Background="{TemplateBinding Background}"
+                                    BorderBrush="{TemplateBinding BorderBrush}"
+                                    BorderThickness="{TemplateBinding BorderThickness}"
+                                    CornerRadius="2">
+                                    <Grid x:Name="markGrid">
+                                        <Path
+                                            x:Name="optionMark"
+                                            Data="M3 7L6.2 10L11 4"
+                                            Opacity="0"
+                                            Stroke="{StaticResource color.icon.checkbox-radio.norm.bg}"
+                                            StrokeLineJoin="Round"
+                                            StrokeThickness="1.5">
+                                            <Path.RenderTransform>
+                                                <TranslateTransform X="-0.5" Y="-1" />
+                                            </Path.RenderTransform>
+                                        </Path>
+                                        <Rectangle
+                                            x:Name="indeterminateMark"
+                                            Margin="2"
+                                            Fill="{StaticResource color.icon.checkbox-radio.norm.border}"
+                                            Opacity="0" />
+                                    </Grid>
+                                </Border>
+                                <ContentPresenter
+                                    x:Name="contentPresenter"
+                                    Grid.Column="1"
+                                    Margin="{TemplateBinding Padding}"
+                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                    Focusable="False"
+                                    RecognizesAccessKey="True"
+                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                            </Grid>
+                            <ControlTemplate.Triggers>
+                                <Trigger Property="HasContent" Value="true">
+                                    <Setter Property="Padding" Value="4,0,0,0" />
+                                </Trigger>
+                                <Trigger Property="IsMouseOver" Value="true">
+                                    <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.hov.bg}" />
+                                    <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.hov.border}" />
+                                </Trigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="IsEnabled" Value="false" />
+                                        <Condition Property="IsChecked" Value="True" />
+                                    </MultiTrigger.Conditions>
+                                    <MultiTrigger.Setters>
+                                        <Setter TargetName="optionMark" Property="Opacity" Value="1" />
+                                        <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
+                                        <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.dis.bg}" />
+                                        <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.dis.border}" />
+                                        <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource color.icon.checkbox-radio.dis.fill}" />
+                                        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
+                                    </MultiTrigger.Setters>
+                                </MultiTrigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="IsEnabled" Value="false" />
+                                        <Condition Property="IsChecked" Value="false" />
+                                    </MultiTrigger.Conditions>
+                                    <MultiTrigger.Setters>
+                                        <Setter TargetName="optionMark" Property="Opacity" Value="0" />
+                                        <Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
+                                        <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.dis.bg}" />
+                                        <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.dis.border}" />
+                                    </MultiTrigger.Setters>
+                                </MultiTrigger>
+                                <!--<Trigger Property="IsPressed" Value="true">
+                                    <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Pressed.Background}" />
+                                    <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Pressed.Border}" />
+                                    <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
+                                    <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
+                                </Trigger>-->
+                                <Trigger Property="IsChecked" Value="true">
+                                    <Setter TargetName="optionMark" Property="Opacity" Value="1" />
+                                    <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
+                                    <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.sel.bg}" />
+                                    <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.sel.bg}" />
+                                </Trigger>
+                                <Trigger Property="IsChecked" Value="{x:Null}">
+                                    <Setter TargetName="optionMark" Property="Opacity" Value="0" />
+                                    <Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
+                                </Trigger>
+                            </ControlTemplate.Triggers>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
+
         </ResourceDictionary>
     </Application.Resources>
 </prism:PrismApplication>

+ 8 - 1
PDF Office/App.xaml.cs

@@ -194,6 +194,7 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<LinkAnnotProperty>();
             containerRegistry.RegisterForNavigation<SharpsAnnotProperty>();
             containerRegistry.RegisterForNavigation<StampAnnotProperty>();
+            containerRegistry.RegisterForNavigation<SignatureAnnotProperty>();
             containerRegistry.RegisterForNavigation<TextAnnotProperty>();
             containerRegistry.RegisterForNavigation<TextEditProperty>();
             containerRegistry.RegisterForNavigation<BatesContent>();
@@ -211,8 +212,14 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<DateFillProperty>();
             containerRegistry.RegisterForNavigation<ShapFillProperty>();
             containerRegistry.RegisterForNavigation<TextFillProperty>();
-            //Form表
+            //Form表
             containerRegistry.RegisterForNavigation<FormsToolContent>();
+            containerRegistry.RegisterForNavigation<TextFieldProperty>();
+            containerRegistry.RegisterForNavigation<ButtonProperty>();
+            containerRegistry.RegisterForNavigation<CheckBoxProperty>();
+            containerRegistry.RegisterForNavigation<ListBoxProperty>();
+            containerRegistry.RegisterForNavigation<RadioButtonProperty>();
+            containerRegistry.RegisterForNavigation<SignProperty>();
 
             #endregion 注册内容组件
 

TEMPAT SAMPAH
PDF Office/ComPDFKit.Viewer.dll


+ 16 - 0
PDF Office/CustomControl/Form/FormFieldCombox.xaml

@@ -0,0 +1,16 @@
+<UserControl
+    x:Class="PDF_Office.CustomControl.Form.FormFieldCombox"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.CustomControl.Form"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
+    <ComboBox
+        Name="Combox"
+        VerticalContentAlignment="Center"
+        SelectedIndex="0"
+        SelectionChanged="Combox_SelectionChanged" />
+</UserControl>

+ 83 - 0
PDF Office/CustomControl/Form/FormFieldCombox.xaml.cs

@@ -0,0 +1,83 @@
+using PDF_Office.Model.From;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl.Form
+{
+    /// <summary>
+    /// FormFieldCombox.xaml 的交互逻辑
+    /// 用于表单显示字段的下拉控件
+    /// </summary>
+    public partial class FormFieldCombox : UserControl
+    {
+        public FormFieldCombox()
+        {
+            InitializeComponent();
+            InitCombox();
+        }
+
+
+
+        public FormFieldType Type
+        {
+            get { return (FormFieldType)GetValue(TypeProperty); }
+            set { SetValue(TypeProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty TypeProperty =
+            DependencyProperty.Register("MyProperty", typeof(FormFieldType), typeof(FormFieldCombox), new PropertyMetadata(FormFieldType.visible));
+
+
+
+        public FormFieldType SetType
+        {
+            get { return (FormFieldType)GetValue(SetTypeProperty); }
+            set { SetValue(SetTypeProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for SetType.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty SetTypeProperty =
+            DependencyProperty.Register("SetType", typeof(FormFieldType), typeof(FormFieldCombox), new PropertyMetadata(FormFieldType.visible,(d,e)=> {
+                (d as FormFieldCombox).SetIndexBySetType((FormFieldType)e.NewValue);
+            }));
+
+
+        /// <summary>
+        /// 根据settype 设置combox索引
+        /// </summary>
+        private void SetIndexBySetType(FormFieldType type)
+        {
+            Combox.SelectedIndex=(int)type;
+        }
+
+
+
+        private void InitCombox()
+        {
+            List<string> list = new List<string>();
+            list.Add("可见");
+            list.Add("隐藏");
+            list.Add("可见但不可打印");
+            list.Add("隐藏但可打印");
+            Combox.ItemsSource = list;
+        }
+
+        private void Combox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            Type = (FormFieldType)Combox.SelectedIndex;
+        }
+    }
+}

+ 71 - 0
PDF Office/CustomControl/MenuItemWithPath.cs

@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace PDF_Office.CustomControl
+{
+    /// <summary>
+    /// 带Path图案的Menuitem 图案颜色跟随文字颜色变化
+    /// </summary>
+    public class MenuItemWithPath:MenuItem
+    {
+        static MenuItemWithPath()
+        {
+            DefaultStyleKeyProperty.OverrideMetadata(typeof(MenuItemWithPath), new FrameworkPropertyMetadata(typeof(MenuItemWithPath)));
+        }
+
+        public override void OnApplyTemplate()
+        {
+            base.OnApplyTemplate();
+        }
+
+
+
+        public Geometry Path
+        {
+            get { return (Geometry)GetValue(PathProperty); }
+            set { SetValue(PathProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for Path.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty PathProperty =
+            DependencyProperty.Register("Path", typeof(Geometry), typeof(MenuItemWithPath), null);
+
+
+
+        public double PathWidth
+        {
+            get { return (double)GetValue(PathWidthProperty); }
+            set { SetValue(PathWidthProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for PathWidth.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty PathWidthProperty =
+            DependencyProperty.Register("PathWidth", typeof(double), typeof(MenuItemWithPath), new PropertyMetadata(16.0));
+
+
+
+        public double PathHeight
+        {
+            get { return (double)GetValue(PathHeightProperty); }
+            set { SetValue(PathHeightProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for PathHeight.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty PathHeightProperty =
+            DependencyProperty.Register("PathHeight", typeof(double), typeof(MenuItemWithPath), new PropertyMetadata(16.0));
+
+
+
+
+
+
+
+
+    }
+}

+ 90 - 0
PDF Office/CustomControl/TextBoxEx.cs

@@ -0,0 +1,90 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace PDF_Office.CustomControl
+{
+    /// <summary>
+    /// 带预文本和圆角的textbox
+    /// </summary>
+    public class TextBoxEx : TextBox
+    {
+        static TextBoxEx()
+        {
+            DefaultStyleKeyProperty.OverrideMetadata(typeof(TextBoxEx), new FrameworkPropertyMetadata(typeof(TextBoxEx)));
+        }
+
+        ~TextBoxEx()
+        {
+            var btn = base.GetTemplateChild("PART_BtnClear") as Button;
+            if (btn != null)
+            {
+                //一定要取消事件挂载,否则可能无法被GC回收
+                btn.Click -= Btn_Click;
+            }
+        }
+
+        public override void OnApplyTemplate()
+        {
+            //需要配合特定的Style才可用
+            var btn = base.GetTemplateChild("PART_BtnClear") as Button;
+            if(btn!=null)
+            {
+                btn.Click += Btn_Click;
+            }
+
+            base.OnApplyTemplate();
+        }
+
+        private void Btn_Click(object sender, RoutedEventArgs e)
+        {
+            this.Text = "";
+            this.Focus();
+        }
+
+        public string PlaceholderText
+        {
+            get { return (string)GetValue(PlaceholderTextProperty); }
+            set { SetValue(PlaceholderTextProperty, value); }
+        }
+
+        public static readonly DependencyProperty PlaceholderTextProperty
+        = DependencyProperty.Register("PlaceholderText", typeof(string), typeof(TextBoxEx), null);
+
+        public CornerRadius CornerRadius
+        {
+            get { return (CornerRadius)GetValue(CornerRadiusProperty); }
+            set { SetValue(CornerRadiusProperty, value); }
+        }
+
+        public static readonly DependencyProperty CornerRadiusProperty =
+            DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(TextBoxEx), new PropertyMetadata(new CornerRadius(4)));
+
+        public Brush PlaceholderForeground
+        {
+            get { return (Brush)GetValue(PlaceholderForegroundProperty); }
+            set { SetValue(PlaceholderForegroundProperty, value); }
+        }
+
+        public static readonly DependencyProperty PlaceholderForegroundProperty =
+          DependencyProperty.Register("PlaceholderForeground", typeof(Brush), typeof(TextBoxEx), new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#94989C"))));
+
+        public Brush MouseOverForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverForegroundProperty);
+            }
+            set { SetValue(MouseOverForegroundProperty, value); }
+        }
+
+        public static readonly DependencyProperty MouseOverForegroundProperty =
+     DependencyProperty.Register("MouseOverForeground", typeof(Brush), typeof(TextBoxEx), new PropertyMetadata(new SolidColorBrush(Colors.Transparent)));
+
+    }
+}

+ 14 - 5
PDF Office/Helper/CacheFilePath.cs

@@ -17,6 +17,10 @@ namespace PDF_Office.Helper
     {
         private static readonly CacheFilePath instance = new CacheFilePath();
 
+        /// <summary>
+        /// 图章缓存文件夹路径
+        /// </summary>
+        List<string> CustomStamp = new List<string> { "CustomStamp" };
         public static CacheFilePath Instance => instance;
 
         private CacheFilePath()
@@ -31,19 +35,24 @@ namespace PDF_Office.Helper
         {
             get
             {
-               return CreateCacheDirectory("CustomStamp");
+               return CreateCacheDirectory(CustomStamp);
             }
         }
-
         /// <summary>
-        /// 在“文档”路径下创建缓存文件夹,传C:\Users\kdan\Documents\PDF Office 以后的文件夹名
+        ///  在“文档”路径下创建缓存文件夹,传C:\Users\kdan\Documents\PDF Office 以后的文件夹名
         /// </summary>
+        /// <param name="directoryName">文件路径列表,首位为第一个文件夹名,以此类推</param>
         /// <returns></returns>
-        private string CreateCacheDirectory(string directoryName)
+        private string CreateCacheDirectory(List<string> directoryName)
         {
             try
             {
-                string Path = System.IO.Path.Combine(App.CurrentPath, directoryName);
+                string Path = App.CurrentPath;
+                for (int i = 0; i < directoryName.Count; i++)
+                {
+                    Path = System.IO.Path.Combine(Path, directoryName[i]);
+                }
+           
                 System.IO.DirectoryInfo directoryInfo = System.IO.Directory.CreateDirectory(Path);
                 if (directoryInfo.Exists
                    && (directoryInfo.Attributes & System.IO.FileAttributes.ReadOnly) != System.IO.FileAttributes.ReadOnly

+ 120 - 40
PDF Office/Helper/PDFToolsHelper.cs

@@ -76,7 +76,7 @@ namespace PDF_Office.Helper
         /// </summary>
         public void SetImagePath(string path)
         {
-            toolItem.Image = path;
+            toolItem.FnImg = path;
         }
 
         /// <summary>
@@ -84,8 +84,8 @@ namespace PDF_Office.Helper
         /// </summary>
         public void SetContent(string fnName,string fnInfo)
         {
-            toolItem.Title = fnName;
-            toolItem.TitleInfo = fnInfo;
+            toolItem.FnName = fnName;
+            toolItem.FnInfo = fnInfo;
         }
 
         /// <summary>
@@ -93,8 +93,7 @@ namespace PDF_Office.Helper
         /// </summary>
         public void SetFnType(PDFFnType fnType)
         {
-            toolItem.FnType = (int)fnType;
-            toolItem.strFnType = Enum.GetName(typeof(PDFFnType), fnType);
+            toolItem.FnType = fnType;
         }
 
 
@@ -105,6 +104,8 @@ namespace PDF_Office.Helper
         public List<ToolItem> QuickTools = null;
         public List<ToolItem> MoreTools = null;
         private static PDFToolsHelper pDFToolsHelper;
+
+        public const int QuickToolCount = 8;//快捷工具显示的个数
         public static PDFToolsHelper GetInstance()
         {
             if (pDFToolsHelper == null)
@@ -127,9 +128,10 @@ namespace PDF_Office.Helper
             //Settings.Default.QuickPDFToolsList.Clear();
             //Settings.Default.Save();
             InitAllTools();
-            ContianNewTools();
             InitQuickTools();
             InitMoreTools();
+
+            //  ContianNewTools();
         }
 
         private void InitAllTools()
@@ -258,12 +260,35 @@ namespace PDF_Office.Helper
             AllTools.Add(compareDoc.toolItem);
         }
 
+        /// <summary>
+        /// 检查是否为新增工具
+        /// </summary>
         private void ContianNewTools()
         {
-            Settings.Default.AllPDFToolsList.Clear();
+            var cacheList = Settings.Default.AllPDFToolsList;
             foreach (var item in AllTools)
             {
-                Settings.Default.AllPDFToolsList.Add(item);
+                ToolItem toolItem = null;
+                foreach (var cacheItem in cacheList)
+                {
+                    var strFnTye = Enum.GetName(typeof(PDFFnType), item.FnType);
+                    if (cacheItem.FnTypeStr != strFnTye && cacheItem.IsNewTool == true)
+                    {
+                        toolItem = item;
+                        break;
+                    }
+                }
+
+                if(toolItem != null && toolItem.IsNewTool == true)
+                {
+                    CacheToolItem cacheTool = new CacheToolItem();
+                    cacheTool.IsNewTool = true;
+                    cacheTool.ToolTypeId = toolItem.ToolTypeId;
+                    cacheTool.ToolTypeStr = Enum.GetName(typeof(PDFToolType), toolItem.ToolType);
+                    cacheTool.FnTypeStr = Enum.GetName(typeof(PDFFnType), toolItem.FnType);
+                    Settings.Default.AllPDFToolsList.Add(cacheTool);
+                }
+               
             }
             Settings.Default.Save();
 
@@ -274,66 +299,121 @@ namespace PDF_Office.Helper
         /// </summary>
         private void InitQuickTools()
         {
-            var settingQuickToolslist = Settings.Default.QuickPDFToolsList;
 
-            int quickToolCount = 0;
-            if (settingQuickToolslist != null && settingQuickToolslist.Count > 0)
+            var cacheList = Settings.Default.AllPDFToolsList;
+
+            if (cacheList == null)
+                cacheList = new AllPDFToolsList();
+
+            if(cacheList.Count > 0)
             {
-                foreach (var item in AllTools)
+                int currentCount = 0;
+                foreach (var cacheItem in cacheList)
                 {
-                    if (quickToolCount == 8)
-                        break;
-
-                    var pdfToolItem = settingQuickToolslist.FirstOrDefault(tool => tool.strFnType == item.strFnType);
-                    if (pdfToolItem != null)
+                    if (cacheItem.ToolLayOutType == 1 && currentCount < QuickToolCount)
                     {
-                        quickToolCount++;
-                        pdfToolItem.FnType = item.FnType;
-                        QuickTools.Add(pdfToolItem);
+                        foreach (var allItem in AllTools)
+                        {
+                            if (cacheItem.FnTypeStr == Enum.GetName(typeof(PDFFnType), allItem.FnType))
+                            {
+                                allItem.IsQuickTool = true;
+
+                                var index = QuickTools.FindIndex(t => t.ToolTypeId > allItem.ToolTypeId);
+                                if (index == -1)
+                                {
+                                    allItem.ToolTypeId = cacheItem.ToolTypeId;
+                                    QuickTools.Add(allItem);
+                                }
+                                else
+                                {
+                                    allItem.ToolTypeId = index;
+                                    QuickTools.Insert(index, allItem);
+                                }
+
+                                currentCount++;
+                                break;
+                            }
+                        }
                     }
                 }
 
-                if (quickToolCount < 8 && AllTools.Count > 8)
+            }
+            else
+            {
+                //当所有工具大于等于快捷工具显示的个数时
+                if (AllTools.Count >= QuickToolCount)
                 {
-                    var count = 8 - quickToolCount;
-                    for (int i = count - 1; i < count; i++)
+                    for (int i = 0; i < QuickToolCount; i++)
                     {
+                        AllTools[i].ToolTypeId = i;
+                        AllTools[i].IsQuickTool = true;
                         QuickTools.Add(AllTools[i]);
                     }
                 }
+                else
+                {
+                    for (int i = 0; i < AllTools.Count; i++)
+                    {
+                        AllTools[i].ToolTypeId = i;
+                        AllTools[i].IsQuickTool = true;
+                        QuickTools.Add(AllTools[i]);
+                    }
+                }
+                SaveAllTools();
+
             }
-            else
-            {
-                if (settingQuickToolslist == null)
-                    Settings.Default.QuickPDFToolsList = new QuickPDFToolsList();
 
-                QuickTools = AllTools.Take(8).ToList<ToolItem>();
 
-                foreach(var item in QuickTools)
-                {
-                    Settings.Default.QuickPDFToolsList.Add(item);
-                }
 
-                Settings.Default.Save();
+        }
 
-            }
-                
+        private void SaveAllTools()
+        {
+            var cacheList = Settings.Default.AllPDFToolsList;
 
+            foreach (var item in AllTools)
+            {
+                CacheToolItem cacheItem = new CacheToolItem();
+                cacheItem.ToolLayOutType = (item.IsQuickTool == true ? 1 : 0);
+                cacheItem.IsNewTool = item.IsNewTool;
+                cacheItem.ToolTypeId = item.ToolTypeId;
+                cacheItem.ToolTypeStr = Enum.GetName(typeof(PDFToolType), item.ToolType);
+                cacheItem.FnTypeStr = Enum.GetName(typeof(PDFFnType), item.FnType);
+                cacheList.Add(cacheItem);
+            }
+            Settings.Default.Save();
         }
 
+
         private void InitMoreTools()
         {
-            List<ToolItem> more = new List<ToolItem>();
+            int currentCount = 0;
+            foreach (var allItem in AllTools)
+            {
+                if (allItem.IsQuickTool == false)
+                {
+                    allItem.ToolTypeId = currentCount;
+                    MoreTools.Add(allItem);
+                    currentCount++;
+                }
+            }
+        }
+
+        public void SaveCacheList()
+        {
+            var cacheLists = Settings.Default.AllPDFToolsList;
+            CacheToolItem cacheItem = null;
             foreach (var item in AllTools)
             {
-                var pdfToolItem = QuickTools.FirstOrDefault(tool => tool.strFnType == item.strFnType);
-                if (pdfToolItem == null)
+                cacheItem = cacheLists.Find(t => t.FnTypeStr == Enum.GetName(typeof(PDFFnType), item.FnType));
+                if (cacheItem != null)
                 {
-                    more.Add(item);
+                    cacheItem.ToolTypeId = item.ToolTypeId;
+                    cacheItem.ToolLayOutType = (item.IsQuickTool == true ? 1 : 0);
                 }
             }
 
-            MoreTools = more;
+            Settings.Default.Save();
         }
     }
 

+ 31 - 0
PDF Office/Model/From/FormFieldType.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.From
+{
+    /// <summary>
+    /// 表单栏位字段
+    /// </summary>
+    public enum FormFieldType
+    {
+        /// <summary>
+        /// 可见
+        /// </summary>
+        visible,
+        /// <summary>
+        /// 隐藏
+        /// </summary>
+        hidden,
+        /// <summary>
+        /// 可见但不可打印
+        /// </summary>
+        visibleCantPrint,
+        /// <summary>
+        /// 隐藏但可打印
+        /// </summary>
+        hiddenCanPrint
+    }
+}

+ 27 - 18
PDF Office/Model/PDFTool/ToolItem.cs

@@ -9,26 +9,35 @@ using System.Threading.Tasks;
 
 namespace PDF_Office.Model.PDFTool
 {
-    public class ToolItem1 : INotifyPropertyChanged
+    public class ToolItem : BindableBase
     {
-        public event PropertyChangedEventHandler PropertyChanged = delegate { };
-
-        private bool _isShowConciseContent = false;
-        public bool IsShowConciseContent
-        {
-            get { return _isShowConciseContent; }
-            set
-            {
-                _isShowConciseContent = value;
-                PropertyChanged(this, new PropertyChangedEventArgs("IsShowConciseContent"));
-            }
-        }
+        /// <summary>
+        /// 是否为新增的工具
+        /// </summary>
         public bool IsNewTool { get; set; }
-        public int Id { get; set; }
-        public PDFToolType Tag { get; set; }
-        public string Image { get; set; }
-        public string TitleInfo { get; set; }
-        public string Title { get; set; }
+        /// <summary>
+        /// 是否为快捷工具
+        /// </summary>
+        public bool IsQuickTool { get; set; }
+        /// <summary>
+        /// 类型:如普通工具、常用工具、付费工具
+        /// </summary>
+        public int ToolTypeId { get; set; }
+        /// <summary>
+        /// 类型:如普通工具、常用工具、付费工具
+        /// </summary>
+        public PDFToolType ToolType { get; set; }
+        /// <summary>
+        /// 功能名称:拆分功能、合并功能、转档功能等
+        /// </summary>
+        public PDFFnType FnType { get; set; }
+
+        #region 显示内容
+
+        public string FnImg { get; set; }
+        public string FnInfo { get; set; }
+        public string FnName { get; set; }
 
+        #endregion
     }
 }

+ 67 - 1
PDF Office/PDF Office.csproj

@@ -207,8 +207,12 @@
     <Compile Include="CustomControl\CustomIconToggleBtn.cs" />
     <Compile Include="CustomControl\CustomImageControl.cs" />
     <Compile Include="CustomControl\DialogContent.cs" />
+    <Compile Include="CustomControl\Form\FormFieldCombox.xaml.cs">
+      <DependentUpon>FormFieldCombox.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\IconAndTextTabItem.cs" />
     <Compile Include="CustomControl\ListBoxItemToolBar.cs" />
+    <Compile Include="CustomControl\MenuItemWithPath.cs" />
     <Compile Include="CustomControl\MessageBoxEx.cs" />
     <Compile Include="CustomControl\NumericUpDown.xaml.cs">
       <DependentUpon>NumericUpDown.xaml</DependentUpon>
@@ -222,6 +226,7 @@
     <Compile Include="CustomControl\PathButton.cs" />
     <Compile Include="CustomControl\SystemControl\CustomCommandAction .cs" />
     <Compile Include="CustomControl\SystemControl\RoutedEventTrigger.cs" />
+    <Compile Include="CustomControl\TextBoxEx.cs" />
     <Compile Include="CustomControl\ToastControl.xaml.cs">
       <DependentUpon>ToastControl.xaml</DependentUpon>
     </Compile>
@@ -308,6 +313,7 @@
     <Compile Include="Model\EditTools\Background\BackgroundTemplateListModel.cs" />
     <Compile Include="Model\EditTools\Watermark\WatermarkCreateModel.cs" />
     <Compile Include="Model\EditTools\Watermark\WatermarkTemplateListModel.cs" />
+    <Compile Include="Model\From\FormFieldType.cs" />
     <Compile Include="Model\PageEdit\CustomInsertModel.cs" />
     <Compile Include="Model\PageEdit\CustomPageItem.cs" />
     <Compile Include="Model\PageEdit\ExtractModel.cs" />
@@ -330,7 +336,6 @@
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>
     </Compile>
-    <Compile Include="Settings.cs" />
     <Compile Include="ViewModels\EditTools\Bates\BatesContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Bates\BatesCreateContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Bates\BatesDocumentContentViewModel.cs" />
@@ -376,6 +381,7 @@
     <Compile Include="ViewModels\Form\FormsToolContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\PDFToolsContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\QuickToolsContentViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SignatureAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\ReadViewContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\RecentFiles\RecentFilesContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\CustomCreateDialogViewModel.cs" />
@@ -634,10 +640,31 @@
     <Compile Include="Views\FillAndSign\PropertyPanel\TextFillProperty.xaml.cs">
       <DependentUpon>TextFillProperty.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Form\ButtonProperty.xaml.cs">
+      <DependentUpon>ButtonProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\CheckBoxProperty.xaml.cs">
+      <DependentUpon>CheckBoxProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\ComboxProperty.xaml.cs">
+      <DependentUpon>ComboxProperty.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Form\FormsToolContent.xaml.cs">
       <DependentUpon>FormsToolContent.xaml</DependentUpon>
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="Views\Form\ListBoxProperty.xaml.cs">
+      <DependentUpon>ListBoxProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\RadioButtonProperty.xaml.cs">
+      <DependentUpon>RadioButtonProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\SignProperty.xaml.cs">
+      <DependentUpon>SignProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\TextFieldProperty.xaml.cs">
+      <DependentUpon>TextFieldProperty.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\HomePanel\CloudDrive\CloudDriveContent.xaml.cs">
       <DependentUpon>CloudDriveContent.xaml</DependentUpon>
     </Compile>
@@ -759,6 +786,9 @@
     <Compile Include="Views\PropertyPanel\AnnotPanel\SharpsAnnotProperty.xaml.cs">
       <DependentUpon>SharpsAnnotProperty.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\AnnotPanel\SignatureAnnotProperty.xaml.cs">
+      <DependentUpon>SignatureAnnotProperty.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\StampAnnotProperty.xaml.cs">
       <DependentUpon>StampAnnotProperty.xaml</DependentUpon>
     </Compile>
@@ -828,6 +858,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="CustomControl\Form\FormFieldCombox.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="CustomControl\LoadingControl.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1120,10 +1154,38 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Form\ButtonProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Form\CheckBoxProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Form\ComboxProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Form\FormsToolContent.xaml">
       <SubType>Designer</SubType>
       <Generator>XamlIntelliSenseFileGenerator</Generator>
     </Page>
+    <Page Include="Views\Form\ListBoxProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Form\RadioButtonProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Form\SignProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Form\TextFieldProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\HomeContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1255,6 +1317,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PropertyPanel\AnnotPanel\SignatureAnnotProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\StampAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 0 - 28
PDF Office/Settings.cs

@@ -1,28 +0,0 @@
-namespace PDF_Office.Properties {
-    
-    
-    // 通过此类可以处理设置类的特定事件: 
-    //  在更改某个设置的值之前将引发 SettingChanging 事件。
-    //  在更改某个设置的值之后将引发 PropertyChanged 事件。
-    //  在加载设置值之后将引发 SettingsLoaded 事件。
-    //  在保存设置值之前将引发 SettingsSaving 事件。
-    internal sealed partial class Settings {
-        
-        public Settings() {
-            // // 若要为保存和更改设置添加事件处理程序,请取消注释下列行: 
-            //
-            // this.SettingChanging += this.SettingChangingEventHandler;
-            //
-            // this.SettingsSaving += this.SettingsSavingEventHandler;
-            //
-        }
-        
-        private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
-            // 在此处添加用于处理 SettingChangingEvent 事件的代码。
-        }
-        
-        private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
-            // 在此处添加用于处理 SettingsSaving 事件的代码。
-        }
-    }
-}

+ 40 - 2
PDF Office/Styles/ButtonStyle.xaml

@@ -163,6 +163,39 @@
         </Setter>
     </Style>
 
+
+    <Style x:Key="NoColorBtn" TargetType="{x:Type Button}">
+        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="BorderBrush" Value="Transparent" />
+        <Setter Property="IsTabStop" Value="False" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Button}">
+                    <Border
+                        x:Name="border"
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}"
+                        SnapsToDevicePixels="true">
+                        <ContentPresenter
+                            x:Name="contentPresenter"
+                            Margin="{TemplateBinding Padding}"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Focusable="False"
+                            RecognizesAccessKey="True"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
     <!--  阅读模式的按钮模板样式  -->
     <ControlTemplate x:Key="zoomout" TargetType="{x:Type ButtonBase}">
         <Border
@@ -358,7 +391,7 @@
         </Style.Triggers>
     </Style>
 
-    <!--  style for Btn.Brand  -->
+    <!--  Design Token Btn.Brand  -->
     <Style
         x:Key="btn.brand"
         BasedOn="{StaticResource Btn.cta}"
@@ -385,7 +418,7 @@
         </Style.Triggers>
     </Style>
 
-    <!--  style for Btn.Sec  -->
+    <!--  Design Token Btn.Sec  -->
     <Style
         x:Key="btn.sec"
         BasedOn="{StaticResource Btn.cta}"
@@ -411,11 +444,13 @@
         </Style.Triggers>
     </Style>
 
+    <!--  Design Token Btn.Sec-icon  -->
     <Style
         x:Key="btn.sec-icon"
         BasedOn="{StaticResource btn.sec}"
         TargetType="{x:Type Button}" />
 
+    <!--  Design Token Btn.Link  -->
     <Style
         x:Key="btn.link"
         BasedOn="{StaticResource Btn.cta}"
@@ -436,6 +471,7 @@
         </Style.Triggers>
     </Style>
 
+    <!--  Design Token Btn.Ghost  -->
     <Style
         x:Key="btn.ghost"
         BasedOn="{StaticResource Btn.cta}"
@@ -461,6 +497,7 @@
         </Style.Triggers>
     </Style>
 
+    <!--  Design Token Btn.icon-Fill  -->
     <Style
         x:Key="btn.icon-fill"
         BasedOn="{StaticResource Btn.cta}"
@@ -483,6 +520,7 @@
         </Style.Triggers>
     </Style>
 
+    <!--  Design Token Btn.Upgrade  -->
     <Style
         x:Key="btn.upgrade"
         BasedOn="{StaticResource Btn.cta}"

+ 53 - 0
PDF Office/Styles/ContextMenuStyle.xaml

@@ -20,4 +20,57 @@
         </MenuItem>
 
     </ContextMenu>
+
+    <ContextMenu x:Key="SelectAnnotContextMenu" FontSize="14">
+        <ContextMenu.ItemContainerStyle>
+            <Style TargetType="MenuItem">
+                <Setter Property="Padding" Value="0,7,0,7"/>
+                <Setter Property="VerticalContentAlignment" Value="Center"/>
+            </Style>
+        </ContextMenu.ItemContainerStyle>
+        <MenuItem Name="CutAnnotMenuItem" Header="剪切" IsEnabled="True">
+            <MenuItem.Icon>
+                <Path Fill="Black"
+                                              Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z">
+                    <Path.RenderTransform>
+                        <TranslateTransform X="3.0000" Y="0"/>
+                    </Path.RenderTransform>
+                </Path>
+            </MenuItem.Icon>
+        </MenuItem>
+
+        <MenuItem Name="CopyAnnotMenuItem" Header="复制" IsEnabled="True">
+            <MenuItem.Icon>
+                <Path Fill="Black"
+                                              Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z">
+                    <Path.RenderTransform>
+                        <TranslateTransform X="3.0000" Y="0"/>
+                    </Path.RenderTransform>
+                </Path>
+            </MenuItem.Icon>
+        </MenuItem>
+
+        <MenuItem Name="DeleteAnnotMenuItem" Header="删除" IsEnabled="True">
+            <MenuItem.Icon>
+                <Path Fill="Black"
+                                              Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z">
+                    <Path.RenderTransform>
+                        <TranslateTransform X="3.0000" Y="0"/>
+                    </Path.RenderTransform>
+                </Path>
+            </MenuItem.Icon>
+        </MenuItem>
+
+        <MenuItem Name="NoteAnnotMenuItem" Header="笔记" IsEnabled="True">
+            <MenuItem.Icon>
+                <Path Fill="Black"
+                                              Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z">
+                    <Path.RenderTransform>
+                        <TranslateTransform X="3.0000" Y="0"/>
+                    </Path.RenderTransform>
+                </Path>
+            </MenuItem.Icon>
+        </MenuItem>
+    </ContextMenu>
+    
 </ResourceDictionary>

File diff ditekan karena terlalu besar
+ 117 - 168
PDF Office/Styles/ContextMenuTextEditStyle.xaml


+ 1 - 1
PDF Office/Styles/RadioButtonStyle.xaml

@@ -282,7 +282,7 @@
 
                         </Trigger>
                         <Trigger Property="IsEnabled" Value="false">
-
+                            <Setter Property="Opacity" TargetName="templateRoot" Value="0.5"/>
                         </Trigger>
                         <Trigger Property="IsPressed" Value="true">
 

+ 319 - 0
PDF Office/Styles/TabControlStyle.xaml

@@ -225,4 +225,323 @@
             </Setter.Value>
         </Setter>
     </Style>
+
+    <ControlTemplate x:Key="Segmented" TargetType="{x:Type TabItem}">
+        <Grid x:Name="templateRoot" SnapsToDevicePixels="True">
+            <Border
+                x:Name="mainBorder"
+                Margin="0"
+                Background="{TemplateBinding Background}"
+                BorderBrush="{TemplateBinding BorderBrush}"
+                BorderThickness="0">
+                <Border
+                    x:Name="innerBorder"
+                    Height="28"
+                    Margin="-1"
+                    Background="White"
+                    BorderBrush="#FFACACAC"
+                    BorderThickness="0"
+                    CornerRadius="4"
+                    Opacity="0" />
+            </Border>
+            <ContentPresenter
+                x:Name="contentPresenter"
+                Margin="{TemplateBinding Padding}"
+                HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
+                VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
+                Content="{TemplateBinding Header}"
+                ContentSource="Header"
+                ContentStringFormat="{TemplateBinding HeaderStringFormat}"
+                ContentTemplate="{TemplateBinding HeaderTemplate}"
+                Focusable="False"
+                RecognizesAccessKey="True"
+                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+        </Grid>
+        <ControlTemplate.Triggers>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="mainBorder" Property="Background">
+                    <Setter.Value>
+                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
+                            <GradientStop Offset="0" Color="#FFECF4FC" />
+                            <GradientStop Offset="1" Color="#FFDCECFC" />
+                        </LinearGradientBrush>
+                    </Setter.Value>
+                </Setter>
+                <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="mainBorder" Property="Background">
+                    <Setter.Value>
+                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
+                            <GradientStop Offset="0" Color="#FFECF4FC" />
+                            <GradientStop Offset="1" Color="#FFDCECFC" />
+                        </LinearGradientBrush>
+                    </Setter.Value>
+                </Setter>
+                <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="mainBorder" Property="Background">
+                    <Setter.Value>
+                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
+                            <GradientStop Offset="0" Color="#FFECF4FC" />
+                            <GradientStop Offset="1" Color="#FFDCECFC" />
+                        </LinearGradientBrush>
+                    </Setter.Value>
+                </Setter>
+                <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="mainBorder" Property="Background">
+                    <Setter.Value>
+                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
+                            <GradientStop Offset="0" Color="#FFECF4FC" />
+                            <GradientStop Offset="1" Color="#FFDCECFC" />
+                        </LinearGradientBrush>
+                    </Setter.Value>
+                </Setter>
+                <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,1,0" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,1,0" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
+                <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
+                <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
+                <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
+                <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
+                <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
+                <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
+                <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
+                <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,1,0" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,1,0" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
+                </MultiDataTrigger.Conditions>
+                <Setter Property="Panel.ZIndex" Value="1" />
+                <Setter Property="Margin" Value="-2,-2,0,-2" />
+                <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
+                </MultiDataTrigger.Conditions>
+                <Setter Property="Panel.ZIndex" Value="1" />
+                <Setter Property="Margin" Value="-2,0,-2,-2" />
+                <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
+                </MultiDataTrigger.Conditions>
+                <Setter Property="Panel.ZIndex" Value="1" />
+                <Setter Property="Margin" Value="0,-2,-2,-2" />
+                <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
+                </MultiDataTrigger.Conditions>
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="0" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="0" />
+                <Setter TargetName="mainBorder" Property="Background" Value="Transparent" />
+            </MultiDataTrigger>
+            <MultiDataTrigger>
+                <MultiDataTrigger.Conditions>
+                    <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
+                    <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
+                </MultiDataTrigger.Conditions>
+                <Setter Property="Panel.ZIndex" Value="1" />
+                <Setter Property="Margin" Value="0" />
+                <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
+                <Setter TargetName="innerBorder" Property="BorderThickness" Value="0" />
+                <Setter TargetName="mainBorder" Property="BorderThickness" Value="0" />
+                <Setter TargetName="mainBorder" Property="Background" Value="Transparent" />
+            </MultiDataTrigger>
+        </ControlTemplate.Triggers>
+    </ControlTemplate>
+
+    <!--  design token TabHeader for Forms Property  -->
+    <Style x:Key="FormTabControl" TargetType="{x:Type TabControl}">
+        <Setter Property="Padding" Value="2" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="BorderThickness" Value="1" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type TabControl}">
+                    <Grid
+                        x:Name="templateRoot"
+                        ClipToBounds="true"
+                        KeyboardNavigation.TabNavigation="Local"
+                        SnapsToDevicePixels="true">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition x:Name="ColumnDefinition0" />
+                            <ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
+                        </Grid.ColumnDefinitions>
+                        <Grid.RowDefinitions>
+                            <RowDefinition x:Name="RowDefinition0" Height="Auto" />
+                            <RowDefinition x:Name="RowDefinition1" Height="*" />
+                        </Grid.RowDefinitions>
+                        <Border
+                            Grid.Row="0"
+                            Grid.Column="0"
+                            Background="{StaticResource color.sys.layout.fg.dark}"
+                            CornerRadius="4">
+                            <TabPanel
+                                x:Name="headerPanel"
+                                Margin="2"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Panel.ZIndex="1"
+                                Background="Transparent"
+                                IsItemsHost="true"
+                                KeyboardNavigation.TabIndex="1" />
+                        </Border>
+                        <Border
+                            x:Name="contentPanel"
+                            Grid.Row="1"
+                            Grid.Column="0"
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            KeyboardNavigation.DirectionalNavigation="Contained"
+                            KeyboardNavigation.TabIndex="2"
+                            KeyboardNavigation.TabNavigation="Local">
+                            <ContentPresenter
+                                x:Name="PART_SelectedContentHost"
+                                Margin="{TemplateBinding Padding}"
+                                ContentSource="SelectedContent"
+                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                        </Border>
+                    </Grid>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="TabStripPlacement" Value="Bottom">
+                            <Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
+                            <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
+                            <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
+                            <Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
+                            <Setter TargetName="headerPanel" Property="Margin" Value="2,0,2,2" />
+                        </Trigger>
+                        <Trigger Property="TabStripPlacement" Value="Left">
+                            <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
+                            <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
+                            <Setter TargetName="headerPanel" Property="Grid.Column" Value="0" />
+                            <Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
+                            <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
+                            <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
+                            <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
+                            <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
+                            <Setter TargetName="headerPanel" Property="Margin" Value="2,2,0,2" />
+                        </Trigger>
+                        <Trigger Property="TabStripPlacement" Value="Right">
+                            <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
+                            <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
+                            <Setter TargetName="headerPanel" Property="Grid.Column" Value="1" />
+                            <Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
+                            <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
+                            <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
+                            <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
+                            <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
+                            <Setter TargetName="headerPanel" Property="Margin" Value="0,2,2,2" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
 </ResourceDictionary>

+ 8 - 0
PDF Office/Styles/TextBoxStyle.xaml

@@ -13,4 +13,12 @@
         <Setter Property="FontWeight" Value="SemiBold" />
         <Setter Property="FontSize" Value="14" />
     </Style>
+
+    <!--  style for property seconed title  -->
+    <Style x:Key="PropertyHeaderLv2" TargetType="{x:Type TextBlock}">
+        <Setter Property="FontFamily" Value="Segoe UI" />
+        <Setter Property="FontSize" Value="12" />
+        <Setter Property="FontWeight" Value="SemiBold" />
+        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv2}" />
+    </Style>
 </ResourceDictionary>

File diff ditekan karena terlalu besar
+ 238 - 0
PDF Office/Themes/Generic.xaml


+ 284 - 4
PDF Office/ViewModels/BOTA/OutLineControlViewModel.cs

@@ -22,6 +22,7 @@ namespace PDF_Office.ViewModels.BOTA
 {
     class OutLineControlViewModel : BindableBase, INavigationAware
     {
+        private string PageDefaultName = "";
         //缩略图相关全局变量,减少内存申请次数
         private WriteableBitmap WirteBitmap;
         private byte[] bmpData;
@@ -31,7 +32,9 @@ namespace PDF_Office.ViewModels.BOTA
         public ObservableCollection<OutlineNode> Outlinelist { get; set; }
 
         private bool isInsertHead = false;
-
+        /// <summary>
+        /// 是否为插入最顶部
+        /// </summary>
         public bool IsInsertHead
         {
             get { return isInsertHead; }
@@ -92,6 +95,9 @@ namespace PDF_Office.ViewModels.BOTA
             PDFViewer.GetCreateOutLineInfo();
         }
 
+        /// <summary>
+        /// 更新大纲数据,并保存状态设置为true
+        /// </summary>
         public void Updata(bool IsMoveData)
         {
             PDFViewer.Document.ReleaseOutlineList();
@@ -118,6 +124,9 @@ namespace PDF_Office.ViewModels.BOTA
             PDFViewer.UndoManager.CanSave = true;
         }
 
+        /// <summary>
+        /// 设置当前大纲对象的Title
+        /// </summary>
         public bool SetTitle(CPDFOutline cPDFOutline, string Title)
         {
             if (cPDFOutline == null)
@@ -127,6 +136,9 @@ namespace PDF_Office.ViewModels.BOTA
             return cPDFOutline.SetTitle(Title);
         }
 
+        /// <summary>
+        /// 跳转到指定位置或者URL动作
+        /// </summary>
         public void GoToPage(TreeViewItem treeViewItem)
         {
             OutlineNode outline = treeViewItem.DataContext as OutlineNode;
@@ -136,7 +148,9 @@ namespace PDF_Office.ViewModels.BOTA
             }
             CPDFAction action = outline.Outline.GetAction();
             if (action != null && action.ActionType != C_ACTION_TYPE.ACTION_TYPE_UNKNOWN)
+            {
                 PDFViewer.ProcessAction(action);
+            }
             else
             {
                 Size size = PDFViewer.Document.GetPageSize(Convert.ToInt32(outline.PageIndex) - 1);
@@ -144,6 +158,9 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
+        /// <summary>
+        /// 收起所有展开
+        /// </summary>
         public void CollapseAll(ObservableCollection<OutlineNode> outlineNodes)
         {
             foreach (var item in outlineNodes)
@@ -156,6 +173,9 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
+        /// <summary>
+        /// 展开所有大纲
+        /// </summary>
         public void ExpandAll(ObservableCollection<OutlineNode> outlineNodes)
         {
             foreach (var item in outlineNodes)
@@ -168,6 +188,217 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
+        /// <summary>
+        /// 更改目标位置
+        /// </summary>
+        public void ChangeOutLineDestination(OutlineNode outline)
+        {
+            List<TextSelectNode> textSelectNodes = PDFViewer.GetCreateOutLineInfo();
+            CPDFDestination info = new CPDFDestination();
+            info.PageIndex = textSelectNodes[0].PageIndex;
+            Size size = PDFViewer.Document.GetPageSize(textSelectNodes[0].PageIndex);
+            info.Position_X = (float)(size.Width - textSelectNodes[0].StartPoint.X);
+            info.Position_Y = (float)(size.Height - textSelectNodes[0].StartPoint.Y);
+            outline.Outline.SetDestination(PDFViewer.Document, info);
+            Updata(false);
+        }
+
+        /// <summary>
+        /// 添加大纲
+        /// </summary>
+        public int AddOutLine(OutlineNode outline)
+        {
+            int ItemIndex = 0;
+            List<TextSelectNode> textSelectNodes = PDFViewer.GetCreateOutLineInfo();
+            CPDFDestination info = new CPDFDestination();
+            if (textSelectNodes.Count <= 0)
+            {
+                //SDK出错了
+                return -1;
+            }
+            info.PageIndex = textSelectNodes[0].PageIndex;
+            Size size = PDFViewer.Document.GetPageSize(info.PageIndex);
+            info.Position_X = (float)(size.Width - textSelectNodes[0].StartPoint.X);
+            info.Position_Y = (float)(size.Height - textSelectNodes[0].StartPoint.Y);
+            CPDFOutline dto = null;
+            //当前有选中大纲列表
+            if (outline != null)
+            {
+                CPDFOutline parentoutline = outline.Outline.GetParent();
+                if (parentoutline == null)
+                {
+                    //获取父级失败,直接添加在根节点最下方
+                    PDFViewer.Document.GetOutlineList();
+                    CPDFOutline parent = PDFViewer.Document.GetOutlineRoot();
+                    if (!parent.InsertChildAtIndex(PDFViewer.Document, parent.ChildList.Count, ref dto))
+                    {
+                        //SDK出错了
+                        return -1;
+                    }
+                    ItemIndex = parent.ChildList.Count;
+                }
+                else
+                {
+                    //获取父节点成功,添加在父节点中选中项下方
+                    int index = GetOutlinesIndexFormParent(parentoutline, outline.Outline);
+                    parentoutline.InsertChildAtIndex(PDFViewer.Document, index, ref dto);
+                    ItemIndex = index + 1;
+                }
+            }
+            else
+            {
+                //未选中数据,直接添加在根节点最下方
+                PDFViewer.Document.GetOutlineList();
+                CPDFOutline parent = PDFViewer.Document.GetOutlineRoot();
+                if (!parent.InsertChildAtIndex(PDFViewer.Document, parent.ChildList.Count, ref dto))
+                {
+                    //SDK出错了
+                    return -1;
+                }
+                ItemIndex = parent.ChildList.Count;
+            }
+            ///当前没有选中文字
+            if (string.IsNullOrEmpty(textSelectNodes[0].SelectText))
+            {
+                string addPageName = PageDefaultName + (textSelectNodes[0].PageIndex + 1).ToString();
+                if (!dto.SetTitle(addPageName))
+                {
+                    //SDK出错了
+                    return -1;
+                }
+            }
+            else
+            {
+                string addPageName = PageDefaultName + textSelectNodes[0].SelectText;
+                if (!dto.SetTitle(addPageName))
+                {
+                    //SDK出错了
+                    return -1;
+                }
+            }
+
+            dto.SetDestination(PDFViewer.Document, info);
+            Updata(false);
+            return ItemIndex;
+        }
+
+        /// <summary>
+        /// 添加大纲到子节点的最后一位
+        /// </summary>
+        public int InsertParentOutline(OutlineNode outline)
+        {
+            int ItemIndex = 0;
+
+            List<TextSelectNode> textSelectNodes = PDFViewer.GetCreateOutLineInfo();
+            CPDFDestination info = new CPDFDestination();
+            if (textSelectNodes.Count <= 0)
+            {
+                //SDK出错了
+                return -1;
+            }
+            info.PageIndex = textSelectNodes[0].PageIndex;
+            info.Position_X = (float)textSelectNodes[0].StartPoint.X;
+            info.Position_Y = (float)textSelectNodes[0].StartPoint.Y;
+
+            CPDFOutline dto = null;
+            CPDFOutline parent = outline.Outline.GetParent();
+            if (parent != null)
+            {
+                CPDFOutline trueparent = parent.GetParent();
+                if (trueparent != null)
+                {
+                    ItemIndex = GetOutlinesIndexFormParent(trueparent, parent);
+                    if (!trueparent.InsertChildAtIndex(PDFViewer.Document, ItemIndex, ref dto))
+                    {
+                        return -1;
+                    }
+                    ItemIndex = ItemIndex + 1;
+                }
+            }
+            ///当前没有选中文字
+            if (string.IsNullOrEmpty(textSelectNodes[0].SelectText))
+            {
+                string addPageName = PageDefaultName + (textSelectNodes[0].PageIndex + 1).ToString();
+                if (!dto.SetTitle(addPageName))
+                {
+                    //SDK出错了
+                    return -1;
+                }
+            }
+            else
+            {
+                string addPageName = PageDefaultName + textSelectNodes[0].SelectText;
+                if (!dto.SetTitle(addPageName))
+                {
+                    //SDK出错了
+                    return -1;
+                }
+            }
+
+            dto.SetDestination(PDFViewer.Document, info);
+            Updata(false);
+            return ItemIndex;
+        }
+
+        /// <summary>
+        /// 添加大纲到父节点的下一位
+        /// </summary>
+        public int InsertChlidOutline(OutlineNode outline)
+        {
+            int ItemIndex = 0;
+            if (outline == null)
+            {
+                return -1;
+            }
+            if (outline.Outline.ChildList != null)
+            {
+                ItemIndex = outline.Outline.ChildList.Count;
+            }
+
+            List<TextSelectNode> textSelectNodes = PDFViewer.GetCreateOutLineInfo();
+            CPDFDestination info = new CPDFDestination();
+            if (textSelectNodes.Count <= 0)
+            {
+                //SDK出错了
+                return -1;
+            }
+            info.PageIndex = textSelectNodes[0].PageIndex;
+            info.Position_X = (float)textSelectNodes[0].StartPoint.X;
+            info.Position_Y = (float)textSelectNodes[0].StartPoint.Y;
+            CPDFOutline dto = null;
+            if (!outline.Outline.InsertChildAtIndex(PDFViewer.Document, ItemIndex, ref dto))
+            {
+                return -1;
+            }
+            ///当前没有选中文字
+            if (string.IsNullOrEmpty(textSelectNodes[0].SelectText))
+            {
+                string addPageName = PageDefaultName + (textSelectNodes[0].PageIndex + 1).ToString();
+                if (!dto.SetTitle(addPageName))
+                {
+                    //SDK出错了
+                    return -1;
+                }
+            }
+            else
+            {
+                string addPageName = PageDefaultName + textSelectNodes[0].SelectText;
+                if (!dto.SetTitle(addPageName))
+                {
+                    //SDK出错了
+                    return -1;
+                }
+            }
+
+            dto.SetDestination(PDFViewer.Document, info);
+            Updata(false);
+            return ItemIndex;
+        }
+
+
+        /// <summary>
+        /// 删除所有大纲
+        /// </summary>
         public void DeleteAll()
         {
             foreach (var item in Outlinelist)
@@ -177,6 +408,9 @@ namespace PDF_Office.ViewModels.BOTA
             Updata(false);
         }
 
+        /// <summary>
+        /// 升级当前大纲
+        /// </summary>
         public void Downgrade(OutlineNode outline)
         {
             if (outline != null)
@@ -189,7 +423,10 @@ namespace PDF_Office.ViewModels.BOTA
                 Updata(false);
             }
         }
-        
+
+        /// <summary>
+        /// 降级当前大纲
+        /// </summary>
         public void Upgrade(OutlineNode outline)
         {
             if (outline != null)
@@ -202,6 +439,9 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
+        /// <summary>
+        /// 删除当前大纲
+        /// </summary>
         public void RemoveOutline(OutlineNode outline)
         {
             outline.Outline.RemoveFromParent(PDFViewer.Document);
@@ -209,12 +449,12 @@ namespace PDF_Office.ViewModels.BOTA
         }
 
         /// <summary>
-        /// 插入大纲到目标节点
+        /// 移动大纲到目标节点
         /// </summary>
         /// <param name="target">目标节点</param>
         /// <param name="soure">需要插入的数据</param>
         /// <returns></returns>
-        public bool InsertOutLine(OutlineNode target, OutlineNode soure)
+        public bool MoveOutLine(OutlineNode target, OutlineNode soure)
         {
             bool Tag = true;
             if (IsInsertHead)
@@ -380,6 +620,9 @@ namespace PDF_Office.ViewModels.BOTA
             return node;
         }
 
+        /// <summary>
+        /// 从当前列表中找到和SDK大纲对象相同的数据
+        /// </summary>
         public OutlineNode FindOutlineFromDto(ObservableCollection<OutlineNode> list, CPDFOutline outline, bool IsMoveData)
         {
             foreach (OutlineNode item in list)
@@ -423,6 +666,42 @@ namespace PDF_Office.ViewModels.BOTA
             return null;
         }
 
+        /// <summary>
+        /// 从当前列表中找到对应的OutlineNode对象
+        /// </summary>
+        public OutlineNode FindOutlineFromList(ObservableCollection<OutlineNode> list, OutlineNode outline, int outlineindex)
+        {
+            //如果传入比对数据为null,则返回最后一项
+            if (outline == null)
+            {
+                return list.Last();
+            }
+            int index = list.IndexOf(outline);
+            if (index >= 0)
+            {
+                if (outlineindex <= index)
+                {
+                    return list[index];
+                }
+                else
+                {
+                    return list[outlineindex - 1];
+                }
+            }
+            else
+            {
+                foreach (var item in list)
+                {
+                    OutlineNode node = FindOutlineFromList(item.Chlidlist, outline, outlineindex);
+                    if (node != null)
+                    {
+                        return node;
+                    }
+                }
+            }
+            return null;
+        }
+
         private int GetIndexFromParent(List<CPDFOutline> parentlist, CPDFOutline outline)
         {
             for (int i = 0; i < parentlist.Count; i++)
@@ -434,6 +713,7 @@ namespace PDF_Office.ViewModels.BOTA
             }
             return -1;
         }
+
         private int GetOutlinesIndexFormParent(CPDFOutline parentoutline, CPDFOutline outline)
         {
             if (parentoutline != null)

+ 67 - 2
PDF Office/ViewModels/Form/FormsToolContentViewModel.cs

@@ -1,15 +1,79 @@
-using Prism.Mvvm;
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;
 
 namespace PDF_Office.ViewModels.Form
 {
     public class FormsToolContentViewModel : BindableBase, INavigationAware
     {
+        private CPDFViewer PDFViewer;
+
+        public ViewContentViewModel viewContentViewModel;
+
+        private IRegionManager regions;
+
+        /// <summary>
+        /// 按钮和属性面板键值对
+        /// </summary>
+        private Dictionary<string, string> btnToProperty = new Dictionary<string, string>();
+
+        private Visibility showPreView;
+
+        /// <summary>
+        /// 显示PreView按钮
+        /// </summary>
+        public Visibility ShowPreView
+        {
+            get { return showPreView; }
+            set
+            {
+                SetProperty(ref showPreView, value);
+            }
+        }
+
+        public DelegateCommand<string> CheckedCommand { get; set; }
+
+
+
+        public FormsToolContentViewModel(IRegionManager regionManager)
+        {
+            regions = regionManager;
+
+            CheckedCommand = new DelegateCommand<string>(CheckedEvent);
+            InitBtnToProperty();
+        }
+
+        private void InitBtnToProperty()
+        {
+            btnToProperty.Add("Text", "TextFieldProperty");
+            btnToProperty.Add("CheckBox", "CheckBoxProperty");
+            btnToProperty.Add("RadioButton", "RadioButtonProperty");
+            btnToProperty.Add("ListBox", "ListBoxProperty");
+            btnToProperty.Add("Combox", "ComboxProperty");
+            btnToProperty.Add("Button", "ButtonProperty");
+            btnToProperty.Add("Sign", "SignProperty");
+        }
+
+        /// <summary>
+        /// Form
+        /// </summary>
+        /// <param name="type"></param>
+        private void CheckedEvent(string type)
+        {
+            if (btnToProperty.ContainsKey(type))
+            {
+                regions.RequestNavigate(RegionNames.PropertyRegionName, btnToProperty[type]);
+            }
+        }
+
         #region Navegation
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
@@ -23,7 +87,8 @@ namespace PDF_Office.ViewModels.Form
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
-            
+            navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel,out viewContentViewModel);
+            navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.ViewContentViewModel, out PDFViewer);
         }
         #endregion
     }

+ 14 - 0
PDF Office/ViewModels/HomePanel/PDFTools/PDFToolsContentViewModel.cs

@@ -22,11 +22,19 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
             set { SetProperty(ref _isExpendTools, value); }
         }
 
+        private bool _isDropTools = false;
+        public bool IsDropTools
+        {
+            get { return _isDropTools; }
+            set { SetProperty(ref _isDropTools, value); }
+        }
+
         #endregion
 
         #region Command and Event
         public DelegateCommand<object> OpenMenuCommand { get; set; }
         public DelegateCommand ExpendCommand { get; set; }
+        public DelegateCommand<object> CustomCommand { get; set; }
 
         public event EventHandler<bool> ExpendToolsHanlder;
 
@@ -41,6 +49,12 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
         {
             OpenMenuCommand = new DelegateCommand<object>(OpenMenu);
             ExpendCommand = new DelegateCommand(Expend);
+            CustomCommand = new DelegateCommand<object>(Custom);
+        }
+
+        private void Custom(object obj)
+        {
+            IsDropTools = true;
         }
 
         private void Expend()

+ 3 - 2
PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs

@@ -2,6 +2,7 @@
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using PDF_Office.Model.PDFTool;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -96,11 +97,11 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
             System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
             dlg.Multiselect = false;
             dlg.Filter = "PDF|*.pdf;*.PDF;";
-            if (toolItem.FnType == (int)PDFFnType.Compress || toolItem.FnType == (int)PDFFnType.Security)
+            if (toolItem.FnType == PDFFnType.Compress || toolItem.FnType == PDFFnType.Security)
             {
                 dlg.Multiselect = true;
             }
-            if (toolItem.FnType == (int)PDFFnType.Merge)
+            if (toolItem.FnType == PDFFnType.Merge)
             {
                 dlg.Multiselect = true;
                 dlg.Filter = "Picture|*.png;*.PNG;*.jpg;*.JPG;*bmp;*jpeg;*gif;*tiff;";

+ 36 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SignatureAnnotPropertyViewModel.cs

@@ -0,0 +1,36 @@
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.Model;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
+{
+    class SignatureAnnotPropertyViewModel : BindableBase, INavigationAware
+    {
+        private CPDFViewer PDFViewer;
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+            return;
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
+            if (PDFViewer == null)
+            {
+                return;
+            }
+        }
+    }
+}

+ 1 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StampAnnotPropertyViewModel.cs

@@ -541,6 +541,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             annote.TextColor = stamp.TextColor;
             annote.IsCheckedDate = stamp.IsCheckedDate;
             annote.IsCheckedTime = stamp.IsCheckedTime;
+            App.CachePath.AddToDeleteFiles(stamp.SourcePath);
             stamps[index] = annote;
             Settings.Default.Save();
         }

+ 163 - 82
PDF Office/ViewModels/PropertyPanel/TextEditPropertyViewModel.cs

@@ -24,6 +24,28 @@ namespace PDF_Office.ViewModels.PropertyPanel
 
         #region 编辑PDF全局
 
+        private bool _isLayoutAvgAlign = false;
+        public bool IsLayoutAvgAlign
+        {
+            get { return _isLayoutAvgAlign; }
+            set
+            {
+                SetProperty(ref _isLayoutAvgAlign, value);
+
+            }
+        }
+
+        private bool _isLayoutAlign = false;
+        public bool IsLayoutAlign
+        {
+            get { return _isLayoutAlign; }
+            set
+            {
+                SetProperty(ref _isLayoutAlign, value);
+
+            }
+        }
+
         private bool _isTextEdit = true;
         public bool IsTextEdit
         {
@@ -202,7 +224,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
         public DelegateCommand ReplaceImgCommand { get; set; }
         public DelegateCommand ExportImgCommand { get; set; }
         public DelegateCommand CropImgCommand { get; set; }
-        public DelegateCommand ImgAlignCheckedCommand { get; set; }
+        public DelegateCommand<object> ImgAlignCheckedCommand { get; set; }
         
 
         /// <summary>
@@ -218,6 +240,8 @@ namespace PDF_Office.ViewModels.PropertyPanel
 
         #endregion
 
+        public event EventHandler ClearCheckedAglin;
+
         #endregion
 
         private ComPDFKitViewer.PDFEditEvent TextEditEvent;
@@ -244,7 +268,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
             ReplaceImgCommand = new DelegateCommand(ReplaceImg);
             ExportImgCommand = new DelegateCommand(ExportImg);
             CropImgCommand = new DelegateCommand(CropImg);
-            ImgAlignCheckedCommand = new DelegateCommand(ImgAlignChecked);
+            ImgAlignCheckedCommand = new DelegateCommand<object>(ImgAlignChecked);
 
             SelectedColorCommand = new DelegateCommand<object>(SelectedColor);
             SelectedFontStyleCommand = new DelegateCommand<object>(SelectedFontStyle);
@@ -259,9 +283,39 @@ namespace PDF_Office.ViewModels.PropertyPanel
             CancelCropCommand = new DelegateCommand(CancelCropImg);
         }
 
-        private void ImgAlignChecked()
+        private void ImgAlignChecked(object obj)
         {
-           
+            if (obj != null)
+            {
+                switch((string)obj)
+                {
+                    case "AlignLeft":
+                        PDFViewer.SetPDFEditAligment(AlignModes.AlignLeft);
+                        break;
+                    case "AlignHorizonCenter":
+                        PDFViewer.SetPDFEditAligment(AlignModes.AlignHorizonCenter);
+                        break;
+                    case "AlignRight":
+                        PDFViewer.SetPDFEditAligment(AlignModes.AlignRight);
+                        break;
+                    case "DistributeHorizontal":
+                        PDFViewer.SetPDFEditAligment(AlignModes.DistributeHorizontal);
+                        break;
+                    case "AlignTop":
+                        PDFViewer.SetPDFEditAligment(AlignModes.AlignTop);
+                        break;
+                    case "AlignVerticalCenter":
+                        PDFViewer.SetPDFEditAligment(AlignModes.AlignVerticalCenter);
+                        break;
+                    case "AlignBottom":
+                        PDFViewer.SetPDFEditAligment(AlignModes.AlignBottom);
+                        break;
+                    case "DistributeVertical":
+                        PDFViewer.SetPDFEditAligment(AlignModes.DistributeVertical);
+                        break;
+                }
+              
+            }
         }
 
         private void CancelCropImg()
@@ -514,11 +568,21 @@ namespace PDF_Office.ViewModels.PropertyPanel
         }
 
 
-
+        private CPDFViewer PDFViewer;
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
 
+            navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
+            if (PDFViewer != null)
+            {
+                PDFViewer.PDFEditActiveHandler -= PDFViewer_PDFEditActiveHandler;
+                PDFViewer.PDFEditActiveHandler += PDFViewer_PDFEditActiveHandler;
+
+                PDFViewer.PDFEditCommandHandler -= PDFViewer_PDFEditCommandHandler;
+                PDFViewer.PDFEditCommandHandler += PDFViewer_PDFEditCommandHandler;
+               
+            }
         }
 
         public bool IsNavigationTarget(NavigationContext navigationContext)
@@ -526,25 +590,16 @@ namespace PDF_Office.ViewModels.PropertyPanel
             return true;
         }
 
-        private CPDFViewer PDFViewer;
+       
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
-            navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
-            if(PDFViewer != null)
-            {
-                PDFViewer.PDFEditActiveHandler -= PDFViewer_PDFEditActiveHandler;
-                PDFViewer.PDFEditActiveHandler += PDFViewer_PDFEditActiveHandler; 
-
-                PDFViewer.PDFEditCommandHandler -= PDFViewer_PDFEditCommandHandler;
-                PDFViewer.PDFEditCommandHandler += PDFViewer_PDFEditCommandHandler;
-                
-            }
         }
 
         private void PDFViewer_PDFEditCommandHandler(object sender, PDFEditCommand e)
         {
-           
-            ContextMenu popMenu = null;
+
+            if (e == null)
+                return;
 
             switch (e.CommandType)
             {
@@ -552,77 +607,24 @@ namespace PDF_Office.ViewModels.PropertyPanel
                    
                     if (e.EditType == ComPDFKit.PDFPage.CPDFEditType.None)
                     {
-                        popMenu = App.Current.FindResource("NoneMenu") as ContextMenu;
-                        if(popMenu != null && popMenu.Items.Count == 4)
+                        e.PopupMenu = EmptyStateMenu(sender);
+                        if (e.PopupMenu != null)
                         {
-                            //复制
-                            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 = AddTextCommand; 
-                            //添加图像
-                             menuItem = popMenu.Items[2] as MenuItem;
-                            menuItem.CommandTarget = (UIElement)sender;
-                            menuItem.Command = AddImgCommand;
-                            //删除
-                            menuItem = popMenu.Items[3] as MenuItem;
-                            menuItem.CommandTarget = (UIElement)sender;
-                            menuItem.Command = ApplicationCommands.Delete;
-
-                            e.PopupMenu = popMenu;
-                            if (e.PopupMenu != null)
-                            {
-                                e.Handle = true;
-                            }
+                            e.Handle = true;
                         }
                     }
                     else if(e.EditType == ComPDFKit.PDFPage.CPDFEditType.EditImage)
                     {
-                        popMenu = App.Current.FindResource("SelectImgMenu") as ContextMenu;
-                        if (popMenu != null && popMenu.Items.Count == 8)
+                        e.PopupMenu = SelectPDFEdit(sender);
+                        if (e.PopupMenu != null)
                         {
-                            //复制
-                            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.Delete;
-                            //裁剪
-                            menuItem = popMenu.Items[4] as MenuItem;
-                            menuItem.CommandTarget = (UIElement)sender;
-                            menuItem.Command = CropModeCommand;
-                            //替换
-                            menuItem = popMenu.Items[5] as MenuItem;
-                            menuItem.CommandTarget = (UIElement)sender;
-                            menuItem.Command = ReplaceImgCommand;
-                            //导出
-                            menuItem = popMenu.Items[6] as MenuItem;
-                            menuItem.CommandTarget = (UIElement)sender;
-                            menuItem.Command = ExportImgCommand;
-                            //排列
-                            menuItem = popMenu.Items[7] as MenuItem;
-                            menuItem.CommandTarget = (UIElement)sender;
-                            menuItem.Command = ApplicationCommands.Cut;
-                            e.PopupMenu = popMenu;
-                            if (e.PopupMenu != null)
-                            {
-                                e.Handle = true;
-                            }
+                            e.Handle = true;
                         }
                     }
+                    else if(e.EditType == ComPDFKit.PDFPage.CPDFEditType.EditText)
+                    {
+                     //   e.SelectText
+                    }
 
             break;
 
@@ -633,16 +635,77 @@ namespace PDF_Office.ViewModels.PropertyPanel
             }
         }
 
+        private ContextMenu EmptyStateMenu(object sender)
+        {
+            var popMenu = App.Current.FindResource("NoneMenu") as ContextMenu;
+            if (popMenu != null && popMenu.Items.Count == 3)
+            {
+                //复制
+                MenuItem menuItem = popMenu.Items[0] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Paste;
+                //添加文本
+                menuItem = popMenu.Items[1] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = AddTextCommand;
+                //添加图像
+                menuItem = popMenu.Items[2] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = AddImgCommand;
+            }
+            return popMenu;
+        }
+
+        private ContextMenu SelectPDFEdit(object sender)
+        {
+            var popMenu = App.Current.FindResource("SelectImgMenu") as ContextMenu;
+            if (popMenu != null && popMenu.Items.Count == 7)
+            {
+                //复制
+                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.Delete;
+                //裁剪
+                menuItem = popMenu.Items[4] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = CropModeCommand;
+                //替换
+                menuItem = popMenu.Items[5] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ReplaceImgCommand;
+                //导出
+                menuItem = popMenu.Items[6] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ExportImgCommand;
+                
+            }
+            return popMenu;
+        }
+
         private void PDFViewer_PDFEditActiveHandler(object sender, List<PDFEditEvent> e)
         {
             if(e != null && e.Count > 0)
             {
+
+                ReLoadLayoutAlign(e.Count);
+
                 IsTextEdit = (e[0].EditType == ComPDFKit.PDFPage.CPDFEditType.EditText);
                 TextEditEvent = e[0];
                 
                 if (IsTextEdit == false)
                 {
-
                     var list = PDFViewer.GetSelectedImages();
                     if(list != null && list.Count > 0)
                     {
@@ -672,8 +735,26 @@ namespace PDF_Office.ViewModels.PropertyPanel
             }
             else
             {
+                IsLayoutAlign = false;
+                IsLayoutAvgAlign = false;
+                ClearCheckedAglin?.Invoke(null, null);
                 IsTextEdit = true;
             }
         }
+
+        private void ReLoadLayoutAlign(int count)
+        {
+            if (count >= 2)
+                IsLayoutAlign = true;
+            else
+                IsLayoutAlign = false;
+
+            if (count >= 3)
+                IsLayoutAvgAlign = true;
+            else
+                IsLayoutAvgAlign = false;
+
+        }
+
     }
 }

+ 6 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -566,6 +566,12 @@ namespace PDF_Office.ViewModels.Tools
             return stampAnnotArgs;
         }
 
+        private AnnotHandlerEventArgs GetSignature()
+        {
+            AddToPropertyPanel(null, null, "SignatureAnnotProperty", null);
+            return null;
+        }
+
         private AnnotHandlerEventArgs GetImage(CustomIconToggleBtn annotBtn)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();

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

@@ -21,6 +21,7 @@ using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Controls.Primitives;
+using System.Windows.Input;
 using System.Windows.Media;
 
 namespace PDF_Office.ViewModels.Tools
@@ -102,6 +103,7 @@ namespace PDF_Office.ViewModels.Tools
                         break;
 
                     case "Signature":
+                        annotArgs = GetSignature();
                         break;
 
                     case "Link":
@@ -430,6 +432,8 @@ namespace PDF_Office.ViewModels.Tools
 
                             break;
                     }
+
+                    ShowPropertyPanel();
                 }
             }
             else
@@ -442,15 +446,81 @@ namespace PDF_Office.ViewModels.Tools
 
         private void PDFViewer_AnnotCommandHandler(object sender, AnnotCommandArgs e)
         {
-            var annotlist = e.AnnotEventArgsList;
+
+            if (e.AnnotEventArgsList == null)
+                return;
+
+           // var annotlist = e.AnnotEventArgsList;
             switch (e.CommandType)
             {
                 case CommandType.Context:
-                    e.Handle = true;
+                    if(e.AnnotEventArgsList.Count > 0)
+                    {
+                        e.PopupMenu = SelectAnnotContextMenu(sender);
+                        if (e.PopupMenu != null)
+                        {
+                            e.Handle = true;
+                        }
+                    }
+                    else
+                    {
+                        e.PopupMenu = NoneSelectAnnotContextMenu(sender);
+                        if (e.PopupMenu != null)
+                        {
+                            e.Handle = true;
+                        }
+
+                    }
+
                     break;
             }
         }
 
+
+        private ContextMenu SelectAnnotContextMenu(object sender)
+        {
+           var  popMenu = App.Current.FindResource("SelectAnnotContextMenu") as ContextMenu;
+            if (popMenu != null && popMenu.Items.Count == 4)
+            {
+                //剪切
+                MenuItem menuItem = popMenu.Items[0] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Cut;
+                //复制
+                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.Delete;
+
+                //笔记
+                //menuItem = popMenu.Items[2] as MenuItem;
+                //menuItem.CommandTarget = (UIElement)sender;
+                //menuItem.Command = ApplicationCommands.no;
+
+            }
+            return popMenu;
+        }
+
+        private ContextMenu NoneSelectAnnotContextMenu(object sender)
+        {
+            var popMenu = new ContextMenu();
+
+            MenuItem menuItem = new MenuItem();
+            menuItem.CommandTarget = (UIElement)sender;
+            menuItem.Command = ApplicationCommands.Paste;
+            popMenu.Items.Add(menuItem);
+
+            menuItem = new MenuItem();
+            menuItem.CommandTarget = (UIElement)sender;
+            menuItem.Command = ApplicationCommands.Copy;
+            popMenu.Items.Add(menuItem);
+
+            return popMenu;
+        }
+
         /// <summary>
         /// 展开显示属性面板
         /// </summary>

+ 8 - 7
PDF Office/ViewModels/Tools/TextEditToolContentViewModel.cs

@@ -71,9 +71,15 @@ namespace PDF_Office.ViewModels.Tools
 
         }
 
+        private CPDFViewer PDFViewer;
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
+            navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
+            if (PDFViewer != null)
+            {
+
 
+            }
         }
 
         public bool IsNavigationTarget(NavigationContext navigationContext)
@@ -81,15 +87,10 @@ namespace PDF_Office.ViewModels.Tools
             return true;
         }
 
-        private CPDFViewer PDFViewer;
+      
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
-            navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
-            if (PDFViewer != null)
-            {
-             
-
-            }
+          
         }
 
     }

+ 5 - 9
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -510,15 +510,11 @@ namespace PDF_Office.ViewModels
         {
             if(currentBar == "TabItemEdit")
             {
-                IsPropertyOpen = true;
-                if (IsPropertyOpen == true)
+                if (PDFViewer != null)
                 {
-                    if(PDFViewer != null)
-                    {
-                        PDFViewer.SetMouseMode(MouseModes.PDFEdit);
-                        SelectedPrpoertyPanel("TextEditProperty", null);
-                    }
-                   
+                    PDFViewer.SetMouseMode(MouseModes.PDFEdit);
+                    SelectedPrpoertyPanel("TextEditProperty", null);
+                    IsPropertyOpen = true;
                 }
             }
             else
@@ -526,7 +522,7 @@ namespace PDF_Office.ViewModels
                 if (PDFViewer != null && PDFViewer.MouseMode == MouseModes.PDFEdit)
                 {
                     IsPropertyOpen = false;
-                    PDFViewer.SetMouseMode(MouseModes.None);
+                    PDFViewer.SetMouseMode(MouseModes.PanTool);
                 }
             }
         }

+ 4 - 1
PDF Office/Views/BOTA/BOTAContent.xaml

@@ -69,7 +69,10 @@
             Style="{StaticResource TabControlWithUnderLineStyle}"
             TabStripPlacement="Left">
             <!--  建立一个空的标头占位  -->
-            <TabItem Height="0" BorderThickness="0" />
+            <TabItem
+                Height="0"
+                Margin="0"
+                BorderThickness="0" />
             <TabItem
                 Name="TabItemThumbnail"
                 Width="48"

+ 10 - 8
PDF Office/Views/BOTA/OutLineControl.xaml

@@ -27,13 +27,15 @@
                     VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Text="Outline" />
             <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                 <customcontrol:PathButton
+            x:Name="BtnAdd"
+            Click="BtnAdd_Click"
             Height="24" Width="24"  IconHeight="20"  IconWidth="20" 
             Icon="{StaticResource Ic_AddButtonPath}"  IconFill="Red"
             IconPress="{StaticResource Ic_AddButtonPath}" IconPressFill="#C04CF8"
             IconMouseOver="{StaticResource Ic_AddButtonPath}" IconMouseOverFill="#C04CF8" />
                 <customcontrol:PathButton
-                    x:Name="BtnMore"
-                    Click="BtnMore_Click"
+            x:Name="BtnMore"
+            Click="BtnMore_Click"
             Height="24" Width="24"  IconHeight="20"  IconWidth="20" 
             Icon="{StaticResource Ic_MoreButtonPath}"  IconFill="Red"
             IconPress="{StaticResource Ic_MoreButtonPath}" IconPressFill="#C04CF8"
@@ -74,7 +76,7 @@
         <Grid Grid.Row="1"
                DragOver="Grid_DragOver"
               DragLeave="Grid_DragLeave">
-            <TreeView x:Name="OutlineView" Grid.Row="1" ItemsSource="{Binding Outlinelist}"
+            <TreeView x:Name="OutlineView" Grid.Row="1" ItemsSource="{Binding Outlinelist}" 
                 BorderThickness="0" AllowDrop="True"
                 VirtualizingPanel.ScrollUnit="Pixel"
                 Drop="OutlineView_Drop"
@@ -83,14 +85,14 @@
                 PreviewMouseDoubleClick="OutlineView_PreviewMouseDoubleClick"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                 <TreeView.ItemTemplate>
-                    <HierarchicalDataTemplate  DataType="{x:Type model:OutlineNode}" ItemsSource="{Binding Path=Chlidlist}">
+                    <HierarchicalDataTemplate   DataType="{x:Type model:OutlineNode}" ItemsSource="{Binding Path=Chlidlist}">
                         <Grid>
                             <Grid.ContextMenu>
                                 <ContextMenu>
-                                    <MenuItem Header="添加条目"/>
-                                    <MenuItem Header="添加子条目"/>
-                                    <MenuItem Header="添加上一级条目" IsEnabled="{Binding CanAddParent}"/>
-                                    
+                                    <MenuItem x:Name="AddMenu" Click="AddMenu_Click" Header="添加条目"/>
+                                    <MenuItem x:Name="AddChlidMenu" Click="AddChlidMenu_Click"  Header="添加子条目"/>
+                                    <MenuItem x:Name="AddParentMenu" Click="AddParentMenu_Click" Header="添加上一级条目" IsEnabled="{Binding CanAddParent}"/>
+
                                     <MenuItem x:Name="DeleteMenu" Click="DeleteMenu_Click" Header="删除"/>
 
                                     <MenuItem x:Name="RenameMenu" Click="RenameMenu_Click" Header="重命名"/>

+ 55 - 3
PDF Office/Views/BOTA/OutLineControl.xaml.cs

@@ -35,6 +35,7 @@ namespace PDF_Office.Views.BOTA
         /// 需要重命名的Item的DataContext
         /// </summary>
         private OutlineNode ReNameOutlineNode = null;
+        bool IsReName = false;
         public OutLineControl()
         {
             InitializeComponent();
@@ -48,7 +49,7 @@ namespace PDF_Office.Views.BOTA
         }
         private void OutlineView_PreviewMouseMove(object sender, MouseEventArgs e)
         {
-            if (e.LeftButton == MouseButtonState.Pressed)
+            if (e.LeftButton == MouseButtonState.Pressed && !IsReName)
             {
                 var pos = e.GetPosition(OutlineView);
                 HitTestResult result = VisualTreeHelper.HitTest(OutlineView, pos);
@@ -154,6 +155,7 @@ namespace PDF_Office.Views.BOTA
             {
                 return;
             }
+
             OutlineNode viewitem = tree.SelectedItem as OutlineNode;
             if (viewitem == null)
             {
@@ -198,7 +200,7 @@ namespace PDF_Office.Views.BOTA
                 HiddenaAllLine();
                 return;
             }
-           (DataContext as OutLineControlViewModel).InsertOutLine(targetoutlineNode, soureoutlineNode);
+           (DataContext as OutLineControlViewModel).MoveOutLine(targetoutlineNode, soureoutlineNode);
 
             HiddenaAllLine();
             (DataContext as OutLineControlViewModel).Updata(true);
@@ -234,6 +236,7 @@ namespace PDF_Office.Views.BOTA
                 }
                 ReNameText.Focus();
                 ReNameText.SelectAll();
+                IsReName = true;
             }
         }
 
@@ -242,12 +245,14 @@ namespace PDF_Office.Views.BOTA
             TextBox newdto = e.OriginalSource as TextBox;
             if (newdto == null)
             {
+                IsReName = false;
                 return;
             }
             string newtitle = string.IsNullOrEmpty(newdto.Text) ? "" : newdto.Text;
             Grid senderdto = sender as Grid;
             if (senderdto == null)
             {
+                IsReName = false;
                 return;
             }
             senderdto.Visibility = Visibility.Collapsed;
@@ -258,18 +263,20 @@ namespace PDF_Office.Views.BOTA
                 {
                     if (newtitle == result.Title)
                     {
+                        IsReName = false;
                         return;
                     }
                     (DataContext as OutLineControlViewModel).SetTitle(result, newtitle);
                 }
                 (DataContext as OutLineControlViewModel).Updata(false);
             }
+            IsReName = false;
         }
 
         private void ToolTip_Opened(object sender, RoutedEventArgs e)
         {
             CustomImageControl imageControl = CommonHelper.FindVisualChild<CustomImageControl>(sender as ToolTip);
-           
+
             OutlineNode outline = imageControl.DataContext as OutlineNode;
             if (outline == null || string.IsNullOrEmpty(outline.PageIndex))
             {
@@ -360,7 +367,52 @@ namespace PDF_Office.Views.BOTA
             alertsMessage.ShowDialog("提示", "确定要将选定大纲的目标位置设置为当前位置吗?", "Cancel", "OK");
             if (alertsMessage.result == ContentResult.Ok)
             {
+                (DataContext as OutLineControlViewModel).ChangeOutLineDestination((sender as MenuItem).DataContext as OutlineNode);
             }
         }
+
+        private void BtnAdd_Click(object sender, RoutedEventArgs e)
+        {
+            int ItemIndex = (DataContext as OutLineControlViewModel).AddOutLine(OutlineView.SelectedItem as OutlineNode);
+            OutlineView.UpdateLayout();
+            OutlineNode node = (DataContext as OutLineControlViewModel).FindOutlineFromList((DataContext as OutLineControlViewModel).Outlinelist, OutlineView.SelectedItem as OutlineNode, ItemIndex);
+            node.IsSelected = true;
+            ReNameOutlineNode = node;
+            node.IsReName = Visibility.Collapsed;
+        }
+
+        private void AddMenu_Click(object sender, RoutedEventArgs e)
+        {
+            ((sender as MenuItem).DataContext as OutlineNode).IsSelected = true;
+            int ItemIndex = (DataContext as OutLineControlViewModel).AddOutLine((sender as MenuItem).DataContext as OutlineNode);
+            OutlineView.UpdateLayout();
+            OutlineNode node = (DataContext as OutLineControlViewModel).FindOutlineFromList((DataContext as OutLineControlViewModel).Outlinelist, OutlineView.SelectedItem as OutlineNode, ItemIndex);
+            node.IsSelected = true;
+            ReNameOutlineNode = node;
+            node.IsReName = Visibility.Collapsed;
+        }
+
+        private void AddParentMenu_Click(object sender, RoutedEventArgs e)
+        {
+            ((sender as MenuItem).DataContext as OutlineNode).IsSelected = true;
+            int ItemIndex = (DataContext as OutLineControlViewModel).InsertParentOutline((sender as MenuItem).DataContext as OutlineNode);
+            OutlineView.UpdateLayout();
+            OutlineNode node = (DataContext as OutLineControlViewModel).FindOutlineFromList((DataContext as OutLineControlViewModel).Outlinelist, (OutlineView.SelectedItem as OutlineNode).Parent, ItemIndex);
+            node.IsSelected = true;
+            ReNameOutlineNode = node;
+            node.IsReName = Visibility.Collapsed;
+        }
+
+        private void AddChlidMenu_Click(object sender, RoutedEventArgs e)
+        {
+            ((sender as MenuItem).DataContext as OutlineNode).IsExpanded = true;
+            ((sender as MenuItem).DataContext as OutlineNode).IsSelected = true;
+            int ItemIndex = (DataContext as OutLineControlViewModel).InsertChlidOutline((sender as MenuItem).DataContext as OutlineNode);
+            OutlineView.UpdateLayout();
+            OutlineNode node = (DataContext as OutLineControlViewModel).FindOutlineFromList((DataContext as OutLineControlViewModel).Outlinelist, (OutlineView.SelectedItem as OutlineNode).Chlidlist[ItemIndex], ItemIndex);
+            node.IsSelected = true;
+            ReNameOutlineNode = node;
+            node.IsReName = Visibility.Collapsed;
+        }
     }
 }

+ 12 - 0
PDF Office/Views/Form/ButtonProperty.xaml

@@ -0,0 +1,12 @@
+<UserControl x:Class="PDF_Office.Views.Form.ButtonProperty"
+             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_Office.Views.Form"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+            
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/Views/Form/ButtonProperty.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.Form
+{
+    /// <summary>
+    /// ButtonProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class ButtonProperty : UserControl
+    {
+        public ButtonProperty()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 12 - 0
PDF Office/Views/Form/CheckBoxProperty.xaml

@@ -0,0 +1,12 @@
+<UserControl x:Class="PDF_Office.Views.Form.CheckBoxProperty"
+             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_Office.Views.Form"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+            
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/Views/Form/CheckBoxProperty.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.Form
+{
+    /// <summary>
+    /// CheckBoxProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class CheckBoxProperty : UserControl
+    {
+        public CheckBoxProperty()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 12 - 0
PDF Office/Views/Form/ComboxProperty.xaml

@@ -0,0 +1,12 @@
+<UserControl x:Class="PDF_Office.Views.Form.ComboxProperty"
+             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_Office.Views.Form"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+            
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/Views/Form/ComboxProperty.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.Form
+{
+    /// <summary>
+    /// ComboxProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class ComboxProperty : UserControl
+    {
+        public ComboxProperty()
+        {
+            InitializeComponent();
+        }
+    }
+}

File diff ditekan karena terlalu besar
+ 60 - 7
PDF Office/Views/Form/FormsToolContent.xaml


+ 23 - 0
PDF Office/Views/Form/FormsToolContent.xaml.cs

@@ -30,5 +30,28 @@ namespace PDF_Office.Views.Form
             MenuAlignment.PlacementTarget = this.BtnAlignment;
             MenuAlignment.IsOpen = true;
         }
+
+        /// <summary>
+        /// 取消右键弹出下拉菜单
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void BtnAlignment_Initialized(object sender, EventArgs e)
+        {
+            //取消右键菜单的绑定,只能左键点击弹出
+            this.BtnAlignment.ContextMenu = null;
+        }
+
+        private void BtnMore_Click(object sender, RoutedEventArgs e)
+        {
+            MenuMore.PlacementTarget = this.BtnMore;
+            MenuMore.IsOpen = true;
+        }
+
+        private void BtnMore_Initialized(object sender, EventArgs e)
+        {
+            //取消右键菜单的绑定,只能左键点击弹出
+            this.BtnMore.ContextMenu = null;
+        }
     }
 }

+ 12 - 0
PDF Office/Views/Form/ListBoxProperty.xaml

@@ -0,0 +1,12 @@
+<UserControl x:Class="PDF_Office.Views.Form.ListBoxProperty"
+             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_Office.Views.Form"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+            
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/Views/Form/ListBoxProperty.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.Form
+{
+    /// <summary>
+    /// ListBoxProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class ListBoxProperty : UserControl
+    {
+        public ListBoxProperty()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 12 - 0
PDF Office/Views/Form/RadioButtonProperty.xaml

@@ -0,0 +1,12 @@
+<UserControl x:Class="PDF_Office.Views.Form.RadioButtonProperty"
+             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_Office.Views.Form"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+            
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/Views/Form/RadioButtonProperty.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.Form
+{
+    /// <summary>
+    /// RadioButtonProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class RadioButtonProperty : UserControl
+    {
+        public RadioButtonProperty()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 12 - 0
PDF Office/Views/Form/SignProperty.xaml

@@ -0,0 +1,12 @@
+<UserControl x:Class="PDF_Office.Views.Form.SignProperty"
+             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_Office.Views.Form"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+            
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/Views/Form/SignProperty.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.Form
+{
+    /// <summary>
+    /// SignProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class SignProperty : UserControl
+    {
+        public SignProperty()
+        {
+            InitializeComponent();
+        }
+    }
+}

File diff ditekan karena terlalu besar
+ 150 - 0
PDF Office/Views/Form/TextFieldProperty.xaml


+ 28 - 0
PDF Office/Views/Form/TextFieldProperty.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.Form
+{
+    /// <summary>
+    /// TextFieldProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class TextFieldProperty : UserControl
+    {
+        public TextFieldProperty()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 3 - 3
PDF Office/Views/HomePanel/PDFTools/PDFToolExpendItem.xaml

@@ -22,16 +22,16 @@
                         <RowDefinition Height="auto"></RowDefinition>
                         <RowDefinition Height="*"></RowDefinition>
                     </Grid.RowDefinitions>
-                    <Image VerticalAlignment="Top" Source="{Binding Image}" HorizontalAlignment="Center" Width="28" Height="28" Margin="5,10,5,5" />
+                    <Image VerticalAlignment="Top" Source="{Binding FnImg}" HorizontalAlignment="Center" Width="28" Height="28" Margin="5,10,5,5" />
 
-                    <TextBlock  Name="TxbTitle" Grid.Column="1" Text="{Binding Title}" 
+                    <TextBlock  Name="TxbTitle" Grid.Column="1" Text="{Binding FnName}" 
                                     FontSize="14" FontWeight="SemiBold" Foreground="Black"
                                     VerticalAlignment="Top" Margin="0,15,0,0"></TextBlock>
 
 
                     <StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1"  Margin="6,0,6,0">
                         <Grid>
-                            <TextBlock Name="ToolInfoBlock" Text="{Binding TitleInfo}"
+                            <TextBlock Name="ToolInfoBlock" Text="{Binding FnInfo}"
                                        Foreground="#666666" LineHeight="16"  FontSize="12"  TextWrapping="Wrap" VerticalAlignment="Center" Margin="0,8,0,0"></TextBlock>
                         </Grid>
 

+ 2 - 2
PDF Office/Views/HomePanel/PDFTools/PDFToolItem.xaml

@@ -18,8 +18,8 @@
                     <ColumnDefinition Width="*"/>
                 </Grid.ColumnDefinitions>
                 <Grid x:Name="GridToolMaskConcise" Grid.ColumnSpan="2" Background="#477EDE" Visibility="Collapsed"/>
-                <Image VerticalAlignment="Top" Source="{Binding Image}" HorizontalAlignment="Center" Width="28" Height="28" Margin="5,10,5,5" />
-                <TextBlock  Name="TxbTitleConcise" Grid.Column="1" Text="{Binding Title}" FontSize="14" FontWeight="SemiBold" VerticalAlignment="Top" Margin="0,15,0,0"></TextBlock>
+                <Image VerticalAlignment="Top" Source="{Binding FnImg}" HorizontalAlignment="Center" Width="28" Height="28" Margin="5,10,5,5" />
+                <TextBlock  Name="TxbTitleConcise" Grid.Column="1" Text="{Binding FnName}" FontSize="14" FontWeight="SemiBold" VerticalAlignment="Top" Margin="0,15,0,0"></TextBlock>
             </Grid>
         </Border>
         

+ 42 - 2
PDF Office/Views/HomePanel/PDFTools/PDFToolsContent.xaml

@@ -66,15 +66,17 @@
             HorizontalAlignment="Right"
             VerticalAlignment="Top"
             Orientation="Horizontal"
-            Visibility="Visible">
+            Visibility="{Binding IsDropTools,Converter={StaticResource InvertBoolToVisibleConvert}}">
 
                     <Button
-                x:Name="BtnCustom"
+                x:Name="BtnCustom" Tag="Custom"
                 Width="68"
                 Height="28"
                 Margin="0,0,0,0"
                 Background="#FFFFFF"
                 Content="Custom"
+                Command="{Binding CustomCommand}"
+                CommandParameter="{Binding ElementName=BtnCustom,Path=Tag}"        
                 Click="BtnTools_Click"
                >
 
@@ -91,6 +93,44 @@
                     </Button>
 
                 </StackPanel>
+
+
+                <StackPanel
+            x:Name="PnlDropToolsUIBtns" Grid.ColumnSpan="2"
+            Grid.Column="0" 
+            Margin="0,0,12,0"
+            HorizontalAlignment="Right"
+            VerticalAlignment="Top"
+            Orientation="Horizontal"
+            Visibility="{Binding IsDropTools,Converter={StaticResource BoolToVisibilityConverter}}">
+
+                    <Button
+                x:Name="BtnCancel" Tag="Cancel"
+                Width="68"
+                Height="28"
+                Margin="0,0,0,0"
+                Background="#FFFFFF"
+                Content="Cancel"
+                CommandParameter="{Binding ElementName=BtnCustom,Path=Tag}"           
+                Click="BtnTools_Click"
+               >
+
+                    </Button>
+
+                    <Button  Tag="Apply"
+                x:Name="BtnApply"
+                Width="28"
+                Height="28"
+                Margin="12,0,0,0"
+                 Background="#FFFFFF" BorderThickness="0" Content="Apply"
+                Command="{Binding OpenMenuCommand}" CommandParameter="{Binding ElementName=BtnMore}"
+               >
+                    </Button>
+
+                </StackPanel>
+
+
+
             </Grid>
            
             <TextBlock Text="首页快捷工具" Margin="0,16,0,0" FontSize="14" FontFamily="PingFang SC"/> 

+ 27 - 10
PDF Office/Views/HomePanel/PDFTools/PDFToolsContent.xaml.cs

@@ -205,7 +205,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
         {
             var source = sourceListItem.Content as ToolItem;
             if (moreTools == null && moreTools.Count != 0) return;
-            List<ToolItem> toolModule = moreTools.FindAll(item => item.Title == source.Title);
+            List<ToolItem> toolModule = moreTools.FindAll(item => item.FnName == source.FnName);
             if (toolModule.Count > 0)
             {
                 // 判断文件夹是否存在,不存在则创建
@@ -214,7 +214,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
                 {
                     folder.Create();
                 }
-                fileName = System.IO.Path.Combine(folder.FullName, $"{source.Title}.png");
+                fileName = System.IO.Path.Combine(folder.FullName, $"{source.FnName}.png");
 
                 SaveToPng(sourceListItem, fileName);
             }
@@ -242,7 +242,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
                 return;
             }
             var targetAToolModule = targetListItem.Content as ToolItem;
-            ToolItem target = quickTools.Find(c => c.Title == targetAToolModule.Title);
+            ToolItem target = quickTools.Find(c => c.FnName == targetAToolModule.FnName);
 
             //查找元数据
             var sourceAToolModule = e.Data.GetData(typeof(ToolItem)) as ToolItem;
@@ -272,7 +272,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
         private void ModuleExchange(ToolItem sourceAToolModule, ToolItem targetAToolModule)
         {
             if (moreTools == null) return;
-            ToolItem source = moreTools.Find(c => c.Title == sourceAToolModule.Title);
+            ToolItem source = moreTools.Find(c => c.FnName == sourceAToolModule.FnName);
             ListBoxEx MoreEx = GetListMoreControl();
             if (MoreEx == null) return;
 
@@ -280,19 +280,25 @@ namespace PDF_Office.Views.HomePanel.PDFTools
             if (ShortEx == null) return;
 
 
-            int targetIndex = quickTools.FindIndex(item => item.Title == targetAToolModule.Title);
+            int targetIndex = quickTools.FindIndex(item => item.FnName == targetAToolModule.FnName);
             if (targetIndex < 0) return;
             if (!isMoreCuts)
             {
                 MoreEx.AllowDrop = false;
                 sourceImage.Visibility = Visibility.Hidden;
-                source = quickTools.Find(c => c.Title == sourceAToolModule.Title);
+                source = quickTools.Find(c => c.FnName == sourceAToolModule.FnName);
                 if (source == null) return;
-                int sourceIndex = quickTools.FindIndex(item => item.Title == sourceAToolModule.Title);
+                int sourceIndex = quickTools.FindIndex(item => item.FnName == sourceAToolModule.FnName);
                 if (sourceIndex < 0) return;
                 var temp = quickTools[sourceIndex];
                 quickTools[sourceIndex] = quickTools[targetIndex];
                 quickTools[targetIndex] = temp;
+
+                var sourceId = source.ToolTypeId;
+                var targetId = target.ToolTypeId;
+                source.ToolTypeId = targetId;
+                target.ToolTypeId = sourceId;
+
                 ShortEx.Items.Refresh();
                 ListBoxCutsWidthChanged(ShortEx);
             }
@@ -306,6 +312,13 @@ namespace PDF_Office.Views.HomePanel.PDFTools
                 quickTools.Remove(target);
                 quickTools.Insert(targetIndex, source);
 
+                source.IsQuickTool = true;
+                target.IsQuickTool = false;
+
+                var targetId = target.ToolTypeId;
+                source.ToolTypeId = targetId;
+                target.ToolTypeId = 0;//移到第一个位置
+
                 MoreEx.Items.Refresh();
                 ShortEx.Items.Refresh(); 
 
@@ -314,8 +327,12 @@ namespace PDF_Office.Views.HomePanel.PDFTools
                 ListBoxCutsWidthChanged(ShortEx);
                 ListBoxCutsWidthChanged(MoreEx);
             }
+
+            if (PDFtools != null)
+                PDFtools.SaveCacheList();
         }
 
+
         private void WorkingWithAnimation(Point pos)
         {
             sourceImage.Visibility = Visibility.Hidden;
@@ -453,7 +470,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
             {
                 var sourceAToolModule = e.Data.GetData(typeof(ToolItem)) as ToolItem;
                 if (sourceAToolModule == null) return;
-                int sourceIndex = quickTools.FindIndex(item => item.Title == sourceAToolModule.Title);
+                int sourceIndex = quickTools.FindIndex(item => item.FnName == sourceAToolModule.FnName);
                 //根据index找listbox对应的item
                 sourceListItem = (ListItemQuickTool)(ShortEx.ItemContainerGenerator.ContainerFromIndex(sourceIndex) as FrameworkElement);
                 if (sourceListItem == null)
@@ -467,7 +484,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
             {
                 var sourceAToolModule = e.Data.GetData(typeof(ToolItem)) as ToolItem;
                 if (sourceAToolModule == null) return;
-                int sourceIndex = moreTools.FindIndex(item => item.Title == sourceAToolModule.Title);
+                int sourceIndex = moreTools.FindIndex(item => item.FnName == sourceAToolModule.FnName);
                 //根据index找listbox对应的item
                 sourceListItem = (ListItemQuickTool)(MoreEx.ItemContainerGenerator.ContainerFromIndex(sourceIndex) as FrameworkElement);
                 if (sourceListItem == null)
@@ -494,7 +511,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
             }
             var targetAToolModule = targetListItem.Content as ToolItem;
             if (targetAToolModule == null) return;
-            target = quickTools.Find(c => c.Title == targetAToolModule.Title);
+            target = quickTools.Find(c => c.FnName == targetAToolModule.FnName);
         }
 
         /// <summary>

+ 13 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/SignatureAnnotProperty.xaml

@@ -0,0 +1,13 @@
+<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.SignatureAnnotProperty"
+             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_Office.Views.PropertyPanel.AnnotPanel"
+             mc:Ignorable="d" >
+    <Grid Background="Red">
+        <Grid Background="Red">
+            
+        </Grid>
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/SignatureAnnotProperty.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.PropertyPanel.AnnotPanel
+{
+    /// <summary>
+    /// SignatureAnnotProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class SignatureAnnotProperty : UserControl
+    {
+        public SignatureAnnotProperty()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 40 - 32
PDF Office/Views/PropertyPanel/TextEditProperty.xaml

@@ -302,7 +302,7 @@
             </Grid>
 
             <TextBlock x:Name="AlignText" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
-            <Grid Width="150" HorizontalAlignment="Left" Margin="0,10,0,0">
+            <Grid x:Name="LayoutAlignGrid" Width="150" HorizontalAlignment="Left" Margin="0,10,0,0">
                 <Grid.RowDefinitions>
                     <RowDefinition Height="*"/>
                     <RowDefinition Height="*"/>
@@ -315,107 +315,115 @@
                     <ColumnDefinition Width="*"/>
                 </Grid.ColumnDefinitions>
 
-                <RadioButton x:Name="BtnImgAlign"  Grid.Row="0" Grid.Column="0" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
-                                      Style="{DynamicResource GreyBgRadioBtnStyle}" >
+                <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"
-                              Fill="{Binding ElementName=BtnImgAlign,Path=Foreground}"/>
+                              Fill="{Binding ElementName=BtnImgLayoutAlignLeft,Path=Foreground}"/>
                     </RadioButton.Content>
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign,Path=Tag}"/>
+                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignLeft,Path=Tag}"/>
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </RadioButton>
 
-                <RadioButton x:Name="BtnImgAlign2"  Grid.Row="0" Grid.Column="1" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
-                                      Style="{DynamicResource GreyBgRadioBtnStyle}" >
+                <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" 
-                            Fill="{Binding ElementName=BtnImgAlign2,Path=Foreground}"/>
+                            Fill="{Binding ElementName=BtnImgLayoutAlignHorizonCenter,Path=Foreground}"/>
                     </RadioButton.Content>
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign2,Path=Tag}"/>
+                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignHorizonCenter,Path=Tag}"/>
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </RadioButton>
 
-                <RadioButton x:Name="BtnImgAlign3"  Grid.Row="0" Grid.Column="2" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
-                                      Style="{DynamicResource GreyBgRadioBtnStyle}" >
+                <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" 
-                               Fill="{Binding ElementName=BtnImgAlign3,Path=Foreground}"/>
+                               Fill="{Binding ElementName=BtnImgLayoutAlignRight,Path=Foreground}"/>
                     </RadioButton.Content>
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign3,Path=Tag}"/>
+                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignRight,Path=Tag}"/>
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </RadioButton>
 
-                <RadioButton x:Name="BtnImgAlign4"  Grid.Row="0" Grid.Column="3" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
-                                      Style="{DynamicResource GreyBgRadioBtnStyle}" >
+                <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" 
-                              Fill="{Binding ElementName=BtnImgAlign4,Path=Foreground}"/>
+                              Fill="{Binding ElementName=BtnImgLayoutAlignDistributeHorizontal,Path=Foreground}"/>
                     </RadioButton.Content>
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign4,Path=Tag}"/>
+                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignDistributeHorizontal,Path=Tag}"/>
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </RadioButton>
 
-                <RadioButton x:Name="BtnImgAlign5"  Grid.Row="1" Grid.Column="0" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
-                                      Style="{DynamicResource GreyBgRadioBtnStyle}" >
+                <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"
-                              Fill="{Binding ElementName=BtnImgAlign5,Path=Foreground}"/>
+                              Fill="{Binding ElementName=BtnImgLayoutAlignTop,Path=Foreground}"/>
                     </RadioButton.Content>
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign5,Path=Tag}"/>
+                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignTop,Path=Tag}"/>
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </RadioButton>
 
-                <RadioButton x:Name="BtnImgAlign6"  Grid.Row="1" Grid.Column="1" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
-                                      Style="{DynamicResource GreyBgRadioBtnStyle}" >
+                <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" 
-                              Fill="{Binding ElementName=BtnImgAlign6,Path=Foreground}"/>
+                              Fill="{Binding ElementName=BtnImgLayoutAlignVerticalCenter,Path=Foreground}"/>
                     </RadioButton.Content>
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign6,Path=Tag}"/>
+                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignVerticalCenter,Path=Tag}"/>
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </RadioButton>
 
-                <RadioButton x:Name="BtnImgAlign7"  Grid.Row="1" Grid.Column="2" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
-                                      Style="{DynamicResource GreyBgRadioBtnStyle}" >
+                <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" 
-                              Fill="{Binding ElementName=BtnImgAlign7,Path=Foreground}"/>
+                              Fill="{Binding ElementName=BtnImgLayoutAlignBottom,Path=Foreground}"/>
                     </RadioButton.Content>
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign7,Path=Tag}"/>
+                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignBottom,Path=Tag}"/>
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </RadioButton>
 
-                <RadioButton x:Name="BtnImgAlign8"  Grid.Row="1" Grid.Column="3" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"     
+                <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"
                               
-                              Fill="{Binding ElementName=BtnImgAlign8,Path=Foreground}"/>
+                              Fill="{Binding ElementName=BtnImgLayoutDistributeVertical,Path=Foreground}"/>
                     </RadioButton.Content>
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="Checked">
-                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign8,Path=Tag}"/>
+                            <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutDistributeVertical,Path=Tag}"/>
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </RadioButton>

+ 29 - 1
PDF Office/Views/PropertyPanel/TextEditProperty.xaml.cs

@@ -21,12 +21,19 @@ namespace PDF_Office.Views.PropertyPanel
     /// </summary>
     public partial class TextEditProperty : UserControl
     {
+        public TextEditPropertyViewModel ViewModel => DataContext as TextEditPropertyViewModel;
         public TextEditProperty()
         {
             InitializeComponent();
         }
 
         private void UserControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            InitEventHandler();
+            InitVariable();
+        }
+
+        private void InitEventHandler()
         {
             FontFamilyBox.SelectionChanged -= FontFamilyBox_SelectionChanged;
             FontStyleBox.SelectionChanged -= FontStyleBox_SelectionChanged;
@@ -40,10 +47,31 @@ namespace PDF_Office.Views.PropertyPanel
 
             FontColorBox.SelectedColorHandler += FontColorBox_SelectedColorHandler;
 
+            if(ViewModel != null)
+            {
+                ViewModel.ClearCheckedAglin -= ViewModel_ClearCheckedAglin;
+                ViewModel.ClearCheckedAglin += ViewModel_ClearCheckedAglin;
+            }
+        }
+
+        private void InitVariable()
+        {
             FontTitleBox.SelectedIndex = 0;
             FontFamilyBox.SelectedIndex = 0;
             FontStyleBox.SelectedIndex = 0;
-            FontSizeBox.SelectedIndex = 0; 
+            FontSizeBox.SelectedIndex = 0;
+        }
+
+        private void ViewModel_ClearCheckedAglin(object sender, EventArgs e)
+        {
+            foreach (var item in LayoutAlignGrid.Children)
+            {
+                var radioBtn = item as RadioButton;
+                if (radioBtn != null)
+                {
+                    radioBtn.IsChecked = false;
+                }
+            }
         }
 
         private void FontSizeBox_SelectionChanged(object sender, SelectionChangedEventArgs e)

+ 16 - 51
PDFSettings/PDFToolsList.cs

@@ -10,7 +10,7 @@ namespace PDFSettings
     /// <summary>
     /// 所有工具列表
     /// </summary>
-    public class AllPDFToolsList : List<ToolItem>
+    public class AllPDFToolsList : List<CacheToolItem>
     {
 
     }
@@ -18,74 +18,39 @@ namespace PDFSettings
     /// <summary>
     /// 快捷工具列表
     /// </summary>
-    public class QuickPDFToolsList : List<ToolItem>
+    public class QuickPDFToolsList : List<CacheToolItem>
     {
 
     }
 
-    public class ToolItem : INotifyPropertyChanged
+    public class CacheToolItem 
     {
-        public event PropertyChangedEventHandler PropertyChanged = delegate { };
-        private bool _isShowConciseContent = false;
-        /// <summary>
-        /// PDF工具集合UI是否显示为只有标题和图标的内容
-        /// </summary>
-        public bool IsShowConciseContent
-        {
-            get { return _isShowConciseContent; }
-            set
-            {
-                _isShowConciseContent = value;
-                PropertyChanged(this, new PropertyChangedEventArgs("IsShowConciseContent"));
-            }
-        }
-
         #region 重要属性
-
-
         /// <summary>
-        /// 是否为新增工具
+        /// 是否为新增工具功能
         /// </summary>
-        public bool IsNew { get; set; }
-
-        #region 工具类型
-
+        public bool IsNewTool { get; set; }
         /// <summary>
-        /// 排序的PDF工具类型:优势工具、常用工具、付费工具等
+        /// 是否为快捷工具;值0为更多工具、值1为快捷工具
+        /// Todo:使用int类型,是因为考虑将来是否会有新需求,除了快捷工具、更多工具外,可能存在以其他布局分类的PDF工具;预留更多的int值以便于缓存数据
         /// </summary>
-        public int ToolType { get; set; }
-        /// <summary>
-        /// 某类型PDF工具的排序Id号
-        /// </summary>
-        public string strToolType { get; set; }
-        #endregion
+        public int ToolLayOutType { get; set; }
 
-
-        #region 功能
         /// <summary>
-        /// PDF工具某功能的枚举值:用来标识功能
+        /// 显示排序号:根据id号递增的方式进行排列顺序
         /// </summary>
-        public int FnType { get; set; }
-        /// <summary>
-        /// 功能名称:拆分功能、合并功能、转档功能等
-        /// </summary>
-        public string strFnType { get; set; }
-        #endregion
+        public int ToolTypeId { get; set; }
 
-        #region 显示内容
         /// <summary>
-        /// 图标路径
+        /// 类型:如普通工具、常用工具、付费工具
         /// </summary>
-        public string Image { get; set; }
-        /// <summary>
-        /// 功能说明内容
-        /// </summary>
-        public string TitleInfo { get; set; }
+        public string ToolTypeStr { get; set; }
+
         /// <summary>
-        /// 功能标题
+        /// 功能名称:拆分功能、合并功能、转档功能等
+        /// Todo:考虑到后续便于迭代PDF工具功能,不能使用int类型进行识别所需的功能,因为int类型会灵活变化,以至于不方便修改增加删除功能;
         /// </summary>
-        public string Title { get; set; }
-        #endregion
+        public string FnTypeStr { get; set; }
 
         #endregion