Explorar el Código

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

# Conflicts:
#	PDF Office/Views/ViewContent.xaml
ZhouJieSheng hace 2 años
padre
commit
bcf671aff3
Se han modificado 24 ficheros con 1190 adiciones y 99 borrados
  1. BIN
      PDF Office/ComPDFKit.Viewer.dll
  2. 102 0
      PDF Office/Helper/KeyEventsHelper.cs
  3. 82 0
      PDF Office/MultilingualResources/PDF Office.en.xlf
  4. 82 0
      PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf
  5. 82 0
      PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf
  6. 1 0
      PDF Office/PDF Office.csproj
  7. 54 0
      PDF Office/Strings/MainPage/MainPage.Designer.cs
  8. 20 0
      PDF Office/Strings/MainPage/MainPage.resx
  9. 58 0
      PDF Office/ViewModels/BOTA/OutLineControlViewModel.cs
  10. 403 72
      PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs
  11. 6 0
      PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs
  12. 22 0
      PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs
  13. 2 0
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SnapshotEditMenuViewModel.cs
  14. 5 0
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs
  15. 16 3
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  16. 12 0
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs
  17. 121 1
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  18. 75 5
      PDF Office/ViewModels/ViewContentViewModel.cs
  19. 4 1
      PDF Office/Views/BOTA/OutLineControl.xaml
  20. 0 12
      PDF Office/Views/BOTA/OutLineControl.xaml.cs
  21. 1 1
      PDF Office/Views/PageEdit/PageEditContent.xaml
  22. 9 1
      PDF Office/Views/Tools/AnnotToolContent.xaml
  23. 29 1
      PDF Office/Views/Tools/AnnotToolContent.xaml.cs
  24. 4 2
      PDF Office/Views/ViewContent.xaml.cs

BIN
PDF Office/ComPDFKit.Viewer.dll


+ 102 - 0
PDF Office/Helper/KeyEventsHelper.cs

@@ -0,0 +1,102 @@
+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.Input;
+
+namespace PDF_Office.Helper
+{
+    //全局快捷键响应
+    public static class KeyEventsHelper
+    {
+        #region Todo 快捷键绑定解绑在其他地方使用
+        //绑定:KeyEventsHelper.KeyDown += ShortCut_KeyDown;
+        //解绑:KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
+
+        #endregion Todo 快捷键绑定解绑在其他地方使用
+
+        public static event EventHandler<KeyEventArgs> KeyDown;
+        private static KeyEventArgs args;
+        static KeyEventsHelper()
+        {
+            EventManager.RegisterClassHandler(typeof(Window), UIElement.KeyDownEvent, (KeyEventHandler)onKeyDown);
+            EventManager.RegisterClassHandler(typeof(ContextMenu), UIElement.KeyDownEvent, (KeyEventHandler)onKeyDown);
+        }
+
+        private static void onKeyDown(object sender, KeyEventArgs e)
+        {
+            if (e != null)
+            {
+                args = e;
+                KeyDown?.Invoke(sender, e);
+            }
+
+        }
+
+        /// <summary>
+        /// 按下单一键,例如:只按下H有效;同时按下其他修饰键如ctrl等无效
+        /// </summary>
+        public static bool IsSingleKey(Key currentkey)
+        {
+            if(args == null) return false;
+
+            if (args.Key == currentkey && args.KeyboardDevice.Modifiers == ModifierKeys.None)
+            {
+                return true;
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 组合键 = 修饰键+序列键
+        /// 例如:同时按下Ctrl + H 或(同时按下Ctrl + [Key=None无任何键]),同时再按下其他修饰键则无响应
+        /// </summary>
+        public static bool IsModifierKey(ModifierKeys modifier, Key currentkey)
+        {
+            if (args == null) return false;
+
+            if (args.Key == currentkey && args.KeyboardDevice.Modifiers == modifier)
+            {
+                return true;
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 例如:按下此键外,再按下其他键也响应(不常用,特殊处理)
+        /// </summary>
+        public static bool IsKeyDown(Key currentkey)
+        {
+            if (args == null) return false;
+
+            if (Keyboard.IsKeyDown(currentkey))
+            {
+                return true;
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 例如:同时按下一个或多个键外,再按下其他键也响应(不常用,特殊处理)
+        /// </summary>
+        public static bool IsKeyDown(List<Key> keys)
+        {
+            if (args == null || keys == null || keys.Count > 0) return false;
+
+            bool result = false;
+            foreach (Key key in keys)
+            {
+                result |= Keyboard.IsKeyDown(key);
+            }
+
+            if (result)
+            {
+                return true;
+            }
+            return false;
+        }
+    }
+}

+ 82 - 0
PDF Office/MultilingualResources/PDF Office.en.xlf

@@ -574,6 +574,88 @@ Drag files to reorder as you need.</target>
           <source>Underline</source>
           <target state="new">Underline</target>
         </trans-unit>
+        <trans-unit id="ViewRightMenu_ActualSize" translate="yes" xml:space="preserve">
+          <source>Actual Size</source>
+          <target state="new">Actual Size</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_BookMode" translate="yes" xml:space="preserve">
+          <source>Book Mode</source>
+          <target state="new">Book Mode</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_FitPage" translate="yes" xml:space="preserve">
+          <source>Fit Page</source>
+          <target state="new">Fit Page</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_FitWidth" translate="yes" xml:space="preserve">
+          <source>Fit Width</source>
+          <target state="new">Fit Width</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_PageDisplay" translate="yes" xml:space="preserve">
+          <source>Page Display</source>
+          <target state="new">Page Display</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_Print" translate="yes" xml:space="preserve">
+          <source>Print</source>
+          <target state="new">Print</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_Search" translate="yes" xml:space="preserve">
+          <source>Search</source>
+          <target state="new">Search</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_SinglePage" translate="yes" xml:space="preserve">
+          <source>Single Page</source>
+          <target state="new">Single Page</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_SinglePageContinuous" translate="yes" xml:space="preserve">
+          <source>Single Page Continuous</source>
+          <target state="new">Single Page Continuous</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_TwoPages" translate="yes" xml:space="preserve">
+          <source>Two Pages</source>
+          <target state="new">Two Pages</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_TwoPagesContinuous" translate="yes" xml:space="preserve">
+          <source>Two Pages Continuous</source>
+          <target state="new">Two Pages Continuous</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_Zoom" translate="yes" xml:space="preserve">
+          <source>Zoom</source>
+          <target state="new">Zoom</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_ZoomIn" translate="yes" xml:space="preserve">
+          <source>Zoom In</source>
+          <target state="new">Zoom In</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_ZoomOut" translate="yes" xml:space="preserve">
+          <source>Zoom Out</source>
+          <target state="new">Zoom Out</target>
+        </trans-unit>
+        <trans-unit id="Thumbnails_Title" translate="yes" xml:space="preserve">
+          <source>Thumbnails</source>
+          <target state="new">Thumbnails</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Title" translate="yes" xml:space="preserve">
+          <source>Bookmark</source>
+          <target state="new">Bookmark</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Delete" translate="yes" xml:space="preserve">
+          <source>Delete</source>
+          <target state="new">Delete</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Rename" translate="yes" xml:space="preserve">
+          <source>Rename</source>
+          <target state="new">Rename</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Change" translate="yes" xml:space="preserve">
+          <source>Change Target Location</source>
+          <target state="new">Change Target Location</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">更改目标位置</note>
+        </trans-unit>
+        <trans-unit id="Bookmark_PageN" translate="yes" xml:space="preserve">
+          <source>Page {0}</source>
+          <target state="new">Page {0}</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">第N页</note>
+        </trans-unit>
       </group>
     </body>
   </file>

+ 82 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf

@@ -574,6 +574,88 @@ Drag files to reorder as you need.</target>
           <source>Underline</source>
           <target state="new">Underline</target>
         </trans-unit>
+        <trans-unit id="ViewRightMenu_ActualSize" translate="yes" xml:space="preserve">
+          <source>Actual Size</source>
+          <target state="new">Actual Size</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_BookMode" translate="yes" xml:space="preserve">
+          <source>Book Mode</source>
+          <target state="new">Book Mode</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_FitPage" translate="yes" xml:space="preserve">
+          <source>Fit Page</source>
+          <target state="new">Fit Page</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_FitWidth" translate="yes" xml:space="preserve">
+          <source>Fit Width</source>
+          <target state="new">Fit Width</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_PageDisplay" translate="yes" xml:space="preserve">
+          <source>Page Display</source>
+          <target state="new">Page Display</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_Print" translate="yes" xml:space="preserve">
+          <source>Print</source>
+          <target state="new">Print</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_Search" translate="yes" xml:space="preserve">
+          <source>Search</source>
+          <target state="new">Search</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_SinglePage" translate="yes" xml:space="preserve">
+          <source>Single Page</source>
+          <target state="new">Single Page</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_SinglePageContinuous" translate="yes" xml:space="preserve">
+          <source>Single Page Continuous</source>
+          <target state="new">Single Page Continuous</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_TwoPages" translate="yes" xml:space="preserve">
+          <source>Two Pages</source>
+          <target state="new">Two Pages</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_TwoPagesContinuous" translate="yes" xml:space="preserve">
+          <source>Two Pages Continuous</source>
+          <target state="new">Two Pages Continuous</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_Zoom" translate="yes" xml:space="preserve">
+          <source>Zoom</source>
+          <target state="new">Zoom</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_ZoomIn" translate="yes" xml:space="preserve">
+          <source>Zoom In</source>
+          <target state="new">Zoom In</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_ZoomOut" translate="yes" xml:space="preserve">
+          <source>Zoom Out</source>
+          <target state="new">Zoom Out</target>
+        </trans-unit>
+        <trans-unit id="Thumbnails_Title" translate="yes" xml:space="preserve">
+          <source>Thumbnails</source>
+          <target state="new">Thumbnails</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Title" translate="yes" xml:space="preserve">
+          <source>Bookmark</source>
+          <target state="new">Bookmark</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Delete" translate="yes" xml:space="preserve">
+          <source>Delete</source>
+          <target state="new">Delete</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Rename" translate="yes" xml:space="preserve">
+          <source>Rename</source>
+          <target state="new">Rename</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Change" translate="yes" xml:space="preserve">
+          <source>Change Target Location</source>
+          <target state="new">Change Target Location</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">更改目标位置</note>
+        </trans-unit>
+        <trans-unit id="Bookmark_PageN" translate="yes" xml:space="preserve">
+          <source>Page {0}</source>
+          <target state="new">Page {0}</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">第N页</note>
+        </trans-unit>
       </group>
     </body>
   </file>

+ 82 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf

@@ -574,6 +574,88 @@ Drag files to reorder as you need.</target>
           <source>Underline</source>
           <target state="new">Underline</target>
         </trans-unit>
+        <trans-unit id="ViewRightMenu_ActualSize" translate="yes" xml:space="preserve">
+          <source>Actual Size</source>
+          <target state="new">Actual Size</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_BookMode" translate="yes" xml:space="preserve">
+          <source>Book Mode</source>
+          <target state="new">Book Mode</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_FitPage" translate="yes" xml:space="preserve">
+          <source>Fit Page</source>
+          <target state="new">Fit Page</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_FitWidth" translate="yes" xml:space="preserve">
+          <source>Fit Width</source>
+          <target state="new">Fit Width</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_PageDisplay" translate="yes" xml:space="preserve">
+          <source>Page Display</source>
+          <target state="new">Page Display</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_Print" translate="yes" xml:space="preserve">
+          <source>Print</source>
+          <target state="new">Print</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_Search" translate="yes" xml:space="preserve">
+          <source>Search</source>
+          <target state="new">Search</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_SinglePage" translate="yes" xml:space="preserve">
+          <source>Single Page</source>
+          <target state="new">Single Page</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_SinglePageContinuous" translate="yes" xml:space="preserve">
+          <source>Single Page Continuous</source>
+          <target state="new">Single Page Continuous</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_TwoPages" translate="yes" xml:space="preserve">
+          <source>Two Pages</source>
+          <target state="new">Two Pages</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_TwoPagesContinuous" translate="yes" xml:space="preserve">
+          <source>Two Pages Continuous</source>
+          <target state="new">Two Pages Continuous</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_Zoom" translate="yes" xml:space="preserve">
+          <source>Zoom</source>
+          <target state="new">Zoom</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_ZoomIn" translate="yes" xml:space="preserve">
+          <source>Zoom In</source>
+          <target state="new">Zoom In</target>
+        </trans-unit>
+        <trans-unit id="ViewRightMenu_ZoomOut" translate="yes" xml:space="preserve">
+          <source>Zoom Out</source>
+          <target state="new">Zoom Out</target>
+        </trans-unit>
+        <trans-unit id="Thumbnails_Title" translate="yes" xml:space="preserve">
+          <source>Thumbnails</source>
+          <target state="new">Thumbnails</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Title" translate="yes" xml:space="preserve">
+          <source>Bookmark</source>
+          <target state="new">Bookmark</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Delete" translate="yes" xml:space="preserve">
+          <source>Delete</source>
+          <target state="new">Delete</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Rename" translate="yes" xml:space="preserve">
+          <source>Rename</source>
+          <target state="new">Rename</target>
+        </trans-unit>
+        <trans-unit id="Bookmark_Change" translate="yes" xml:space="preserve">
+          <source>Change Target Location</source>
+          <target state="new">Change Target Location</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">更改目标位置</note>
+        </trans-unit>
+        <trans-unit id="Bookmark_PageN" translate="yes" xml:space="preserve">
+          <source>Page {0}</source>
+          <target state="new">Page {0}</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">第N页</note>
+        </trans-unit>
       </group>
     </body>
   </file>

+ 1 - 0
PDF Office/PDF Office.csproj

@@ -332,6 +332,7 @@
     <Compile Include="Helper\CacheFilePath.cs" />
     <Compile Include="Helper\ConverterHelper.cs" />
     <Compile Include="Helper\CropPageUndoManager.cs" />
+    <Compile Include="Helper\KeyEventsHelper.cs" />
     <Compile Include="Helper\Win32Helper.cs" />
     <Compile Include="Helper\DpiHelpers.cs" />
     <Compile Include="Helper\EditToolsHelper.cs" />

+ 54 - 0
PDF Office/Strings/MainPage/MainPage.Designer.cs

@@ -60,6 +60,51 @@ namespace PDF_Office.Strings.MainPage {
             }
         }
         
+        /// <summary>
+        ///   查找类似 Change Target Location 的本地化字符串。
+        /// </summary>
+        public static string Bookmark_Change {
+            get {
+                return ResourceManager.GetString("Bookmark_Change", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Delete 的本地化字符串。
+        /// </summary>
+        public static string Bookmark_Delete {
+            get {
+                return ResourceManager.GetString("Bookmark_Delete", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Page {0} 的本地化字符串。
+        /// </summary>
+        public static string Bookmark_PageN {
+            get {
+                return ResourceManager.GetString("Bookmark_PageN", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Rename 的本地化字符串。
+        /// </summary>
+        public static string Bookmark_Rename {
+            get {
+                return ResourceManager.GetString("Bookmark_Rename", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Bookmark 的本地化字符串。
+        /// </summary>
+        public static string Bookmark_Title {
+            get {
+                return ResourceManager.GetString("Bookmark_Title", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 Enter Read Mode, tap ESC to exit 的本地化字符串。
         /// </summary>
@@ -485,6 +530,15 @@ namespace PDF_Office.Strings.MainPage {
             }
         }
         
+        /// <summary>
+        ///   查找类似 Thumbnails 的本地化字符串。
+        /// </summary>
+        public static string Thumbnails_Title {
+            get {
+                return ResourceManager.GetString("Thumbnails_Title", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 Book Mode 的本地化字符串。
         /// </summary>

+ 20 - 0
PDF Office/Strings/MainPage/MainPage.resx

@@ -117,6 +117,23 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <data name="Bookmark_Change" xml:space="preserve">
+    <value>Change Target Location</value>
+    <comment>更改目标位置</comment>
+  </data>
+  <data name="Bookmark_Delete" xml:space="preserve">
+    <value>Delete</value>
+  </data>
+  <data name="Bookmark_PageN" xml:space="preserve">
+    <value>Page {0}</value>
+    <comment>第N页</comment>
+  </data>
+  <data name="Bookmark_Rename" xml:space="preserve">
+    <value>Rename</value>
+  </data>
+  <data name="Bookmark_Title" xml:space="preserve">
+    <value>Bookmark</value>
+  </data>
   <data name="GlobalTip_ESCReadMode" xml:space="preserve">
     <value>Enter Read Mode, tap ESC to exit</value>
     <comment>进入阅读模式,提示可以按ESC退出</comment>
@@ -270,6 +287,9 @@ Drag files to reorder as you need.</value>
   <data name="Stamp_Title" xml:space="preserve">
     <value>Stamp</value>
   </data>
+  <data name="Thumbnails_Title" xml:space="preserve">
+    <value>Thumbnails</value>
+  </data>
   <data name="ViewProperties_Book" xml:space="preserve">
     <value>Book Mode</value>
     <comment>书本模式</comment>

+ 58 - 0
PDF Office/ViewModels/BOTA/OutLineControlViewModel.cs

@@ -22,6 +22,63 @@ namespace PDF_Office.ViewModels.BOTA
 {
     class OutLineControlViewModel : BindableBase, INavigationAware
     {
+        #region 文案
+
+        private string T_title;
+
+        public string T_Title
+        {
+            get { return T_title; }
+            set
+            {
+                SetProperty(ref T_title, value);
+            }
+        }
+
+        private string T_expand;
+
+        public string T_Expand
+        {
+            get { return T_expand; }
+            set
+            {
+                SetProperty(ref T_expand, value);
+            }
+        }
+
+        private string T_collapse;
+
+        public string T_Collapse
+        {
+            get { return T_collapse; }
+            set
+            {
+                SetProperty(ref T_collapse, value);
+            }
+        }
+
+        private string T_removeAll;
+
+        public string T_RemoveAll
+        {
+            get { return T_removeAll; }
+            set
+            {
+                SetProperty(ref T_removeAll, value);
+            }
+        }
+
+
+        private void InitString()
+        {
+            T_Title = App.MainPageLoader.GetString("Outline_Title");
+            T_Expand = App.MainPageLoader.GetString("Outline_Expand");
+            T_Collapse = App.MainPageLoader.GetString("Outline_Collapse");
+            T_RemoveAll = App.MainPageLoader.GetString("Outline_RemoveAll");
+        }
+
+        #endregion
+
         private string PageDefaultName = "";
         //缩略图相关全局变量,减少内存申请次数
         private WriteableBitmap WirteBitmap;
@@ -63,6 +120,7 @@ namespace PDF_Office.ViewModels.BOTA
             DeleteAllCommand = new DelegateCommand(DeleteAll);
             CollapseAllCommand = new DelegateCommand<ObservableCollection<OutlineNode>>(CollapseAll);
             ExpandAllCommand = new DelegateCommand<ObservableCollection<OutlineNode>>(ExpandAll);
+            InitString();
         }
 
         public bool IsNavigationTarget(NavigationContext navigationContext)

+ 403 - 72
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs

@@ -42,6 +42,14 @@ using ToolTip = System.Windows.Controls.ToolTip;
 using ContentControl = System.Windows.Controls.ContentControl;
 using MouseEventArgs = System.Windows.Input.MouseEventArgs;
 using Pen = System.Windows.Media.Pen;
+using PDF_Office.Model.PropertyPanel.AnnotPanel;
+using RadioButton = System.Windows.Controls.RadioButton;
+using Style = System.Windows.Style;
+using PDF_Office.CustomControl;
+using System.Windows.Controls.Primitives;
+using Window = System.Windows.Window;
+using Task = System.Threading.Tasks.Task;
+using Size = System.Windows.Size;
 
 namespace PDF_Office.ViewModels.FillAndSign
 {
@@ -56,24 +64,32 @@ namespace PDF_Office.ViewModels.FillAndSign
         public List<List<Point>> ShapePoints = new List<List<Point>>();
         private string Shape = "HookShape";
         private PopMenu FreeHandAnnotPopMenu;
+        private PopMenu FreeTextAnnotPopMenu;
         private PopMenu MultiAnnotPopMenu;
         private IRegionManager regions { get; set; }
         private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
         public static bool IsEdit = false;
-        public static bool IsSignPoint=false;
+        public static bool IsSignPoint = false;
         public Brush SelectColor = new SolidColorBrush(Colors.GreenYellow);
         public double FillOpacity = 1;
         public double LineWidth = 1;
         public double LineWidthMultiple = 1;
 
-        private bool _HookShapeIsCheck=true;
-        public bool HookShapeIsCheck {
+        private bool _HookShapeIsCheck = true;
+        public bool HookShapeIsCheck
+        {
             get { return _HookShapeIsCheck; }
-            set { SetProperty(ref _HookShapeIsCheck,value); }
-        
+            set { SetProperty(ref _HookShapeIsCheck, value); }
+
         }
         #endregion
         public DelegateCommand<object> AnnotDefaultValue_MenuCommand { get; set; }
+
+        public DelegateCommand<object> FreeTextFontFamily_MenuCommand { get; set; }
+
+        public DelegateCommand<object> AnnotColorPalette_MenuCommand { get; set; }
+
+        public DelegateCommand<object> FreeTextAglin_MenuCommand { get; set; }
         #region Command
         public DelegateCommand<RoutedEventArgs> CheckCommand { get; set; }
 
@@ -91,9 +107,212 @@ namespace PDF_Office.ViewModels.FillAndSign
             ToolExpandDict.Add("Freetext", AnnotArgsType.AnnotFreeText);
             InitDictionary();
             AnnotDefaultValue_MenuCommand = new DelegateCommand<object>(AnnotDefaultValues_Menu);
+            AnnotColorPalette_MenuCommand = new DelegateCommand<object>(AnnotColorPalette_Menu);
+            FreeTextFontFamily_MenuCommand = new DelegateCommand<object>(FreeTextFontFamily_Menu);
+            FreeTextAglin_MenuCommand = new DelegateCommand<object>(FreeTextAglin_Menu);
             InitSelectFreeHandAnnotMenu();
+            InitSelectFreeTextAnnotMenu();
+        }
+        private System.Windows.Controls.Primitives.Popup popup = null;
+        private async void AnnotColorPalette_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                if (annot != null)
+                {
+                    var item = new ColorDropBoxPop();
+                    item.DataContext = menu;
+                    item.ColorSelected -= AnnotMenu_ColorSelected;
+                    item.ColorSelected += AnnotMenu_ColorSelected;
+
+                    if (popup == null)
+                        popup = new System.Windows.Controls.Primitives.Popup();
+
+                    ContentControl window = null;
+                    if (PDFViewer.Parent as ContentControl != null)
+                        window = PDFViewer.Parent as ContentControl;
+                    else
+                        window = App.Current.MainWindow;
+
+                    popup.Child = item;
+                    popup.PlacementRectangle = new Rect(Mouse.GetPosition(window), new Size(item.Width, item.Height));
+                    popup.Placement = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
+                    popup.PlacementTarget = window;
+                    popup.IsOpen = true;
+
+                    Window parentWnd = Window.GetWindow(App.Current.MainWindow);
+                    if (parentWnd != null)
+                    {
+                        parentWnd.MouseDown -= parentWnd_MouseDown;
+                        parentWnd.MouseDown += parentWnd_MouseDown;
+                    }
+
+                    while (popup.IsOpen)
+                        await Task.Delay(20);
+
+                    parentWnd.MouseDown -= parentWnd_MouseDown;
+                    popup = null;
+                }
+            }
+        }
+
+        private void AnnotMenu_ColorSelected(object sender, Color e)
+        {
+            if (sender != null)
+            {
+                var menu = (sender as FrameworkElement).DataContext as CusMenuItem;
+                if (menu == null) return;
+
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                if (annot != null)
+                {
+                    if (annot is FreehandAnnotArgs || annot is StickyAnnotArgs || annot is LineAnnotArgs)
+                    {
+                        var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.Color, e);
+                        AnnotEvent?.UpdateAnnot();
+                    }
+                    else if (annot is FreeTextAnnotArgs)
+                    {
+                        var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                        if (menu.tag.ToString() == "FontColor")
+                            AnnotEvent?.UpdateAttrib(AnnotAttrib.FontColor, e);
+                        else
+                            AnnotEvent?.UpdateAttrib(AnnotAttrib.FillColor, e);
+
+                        AnnotEvent?.UpdateAnnot();
+                    }
+                    else if (annot is SquareAnnotArgs || annot is CircleAnnotArgs)
+                    {
+                        var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                        if (menu.tag.ToString() == "FillColor")
+                            AnnotEvent?.UpdateAttrib(AnnotAttrib.FillColor, e);
+                        else
+                            AnnotEvent?.UpdateAttrib(AnnotAttrib.Color, e);
+
+                        AnnotEvent?.UpdateAnnot();
+                    }
+                    else if (annot is TextHighlightAnnotArgs || annot is TextUnderlineAnnotArgs || annot is TextStrikeoutAnnotArgs)
+                    {
+                        var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.Color, e);
+                        AnnotEvent?.UpdateAnnot();
+                    }
+                }
+            }
+        }
+        private void parentWnd_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            var ui = Mouse.DirectlyOver as FrameworkElement;
+            if (ui != null)
+            {
+                if (popup != null)
+                {
+                    popup.IsOpen = false;
+                }
+            }
+        }
+        private void FreeTextFontFamily_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                if (annot != null)
+                {
+                    var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                    AnnotEvent?.UpdateAttrib(AnnotAttrib.FontFamily, new FontFamily(menu.tag.ToString()));
+                    AnnotEvent?.UpdateAnnot();
+                }
+            }
+        }
+
+        private void FreeTextAglin_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                var tag = menu.control.Tag;
+                if (annot != null && tag != null)
+                {
+                    var strTag = tag.ToString();
+
+                    var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                    if (strTag == "Left")
+                    {
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Left);
+                    }
+                    else if (strTag == "Center")
+                    {
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Center);
+                    }
+                    else if (strTag == "Right")
+                    {
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Right);
+                    }
+                    else if (strTag == "Justify")
+                    {
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Justify);
+                    }
+
+                    AnnotEvent?.UpdateAnnot();
+                }
+            }
+        }
+
+        private void AnnotDefaultValues_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                if (annot != null)
+                {
+                    if (annot is FreehandAnnotArgs)
+                    {
+                        var freeHand = annot as FreehandAnnotArgs;
+                        var color = freeHand.InkColor;
+
+                        Settings.Default.AppProperties.Annotate.FreeHandColor = color;
+
+                        var FreehandDefault = GetAnnotDefault(AnnotArgsType.AnnotFreehand);
+                        FreehandDefault.ForgoundColor = color;
+                        FreehandDefault.Opacity = freeHand.Transparency;
+                        FreehandDefault.Thickness = freeHand.LineWidth;
+
+                        var isSolid = AnnotPropertyPanel.IsSolidStyle(freeHand.LineDash);
+                        if (isSolid)
+                        {
+                            FreehandDefault.DashArray = null;
+                        }
+                        else
+                        {
+                            FreehandDefault.DashArray = new List<double>();
+                            foreach (var item in freeHand.LineDash.Dashes)
+                            {
+                                FreehandDefault.DashArray.Add(item);
+                            }
+                        }
+
+                        SettingHelper.SetAnnotDefaultProperty(FreehandDefault);
+                    }
+                }
+            }
+        }
+
+        private DefaultAnnotProperty GetAnnotDefault(AnnotArgsType annotArgsType)
+        {
+            var Annot = SettingHelper.GetAnnotDefaultProperty(annotArgsType);
+            if (Annot == null)
+            {
+                Annot = new DefaultAnnotProperty();
+                Annot.AnnotToolType = annotArgsType;
+            }
+            return Annot;
         }
-        private void AnnotDefaultValues_Menu(object e){}
         private void CheckedEvent(RoutedEventArgs e)
         {
             IsEdit = false;
@@ -151,11 +370,11 @@ namespace PDF_Office.ViewModels.FillAndSign
         }
         private void InitCheckedEvent(string e)
         {
-            IsEdit = false;
-    
-
-            //NavigateToProperty(control.Name);
-            //不创建注释,属于注释模板
+            IsEdit = false;
+
+
+            //NavigateToProperty(control.Name);
+            //不创建注释,属于注释模板
             bool isTemplateAnnot = false;
             bool isSnapshotEdit = false;
             AnnotHandlerEventArgs annotArgs = null;
@@ -208,7 +427,7 @@ namespace PDF_Office.ViewModels.FillAndSign
         private void FindAnnotTypeKey(string tag, ref AnnotHandlerEventArgs annotArgs, bool isRightMenuAdd = false)
         {
             LineWidthMultiple = 1;
-            IsSignPoint=false;
+            IsSignPoint = false;
             switch (tag)
             {
 
@@ -230,13 +449,13 @@ namespace PDF_Office.ViewModels.FillAndSign
                     break;
                 case "RbtnFork"://叉
                     Shape = "ForkShape";
-                   
+
                     ShapePoints = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
                     annotArgs = GetStamp();
                     break;
                 case "RbtnRectangle"://矩形
                     Shape = "RectShape";
-                    ShapePoints = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(28, 5) }, new List<Point> { new Point(28, 5), new Point(28, 27) }, new List<Point> { new Point(28, 27), new Point(5, 27) }, new List<Point> {  new Point(5, 27)  ,new Point(5, 5)} };
+                    ShapePoints = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(28, 5) }, new List<Point> { new Point(28, 5), new Point(28, 27) }, new List<Point> { new Point(28, 27), new Point(5, 27) }, new List<Point> { new Point(5, 27), new Point(5, 5) } };
                     annotArgs = GetStamp();
                     break;
                 case "RbtnLine"://下划线
@@ -274,7 +493,7 @@ namespace PDF_Office.ViewModels.FillAndSign
         {
             StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
 
-            stampAnnotArgs.SetInkData(ShapePoints, LineWidth* LineWidthMultiple, (SelectColor as SolidColorBrush).Color);
+            stampAnnotArgs.SetInkData(ShapePoints, LineWidth * LineWidthMultiple, (SelectColor as SolidColorBrush).Color);
             //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
             //PDFViewer.SetToolParam(stampArgs);
             //StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
@@ -311,7 +530,7 @@ namespace PDF_Office.ViewModels.FillAndSign
         public void SetStamp()
         {
             StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
-            stampAnnotArgs.SetInkData(ShapePoints, LineWidth* LineWidthMultiple, (SelectColor as SolidColorBrush).Color);
+            stampAnnotArgs.SetInkData(ShapePoints, LineWidth * LineWidthMultiple, (SelectColor as SolidColorBrush).Color);
             //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
             //PDFViewer.SetToolParam(stampArgs);
             //StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
@@ -371,13 +590,13 @@ namespace PDF_Office.ViewModels.FillAndSign
         {
 
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
-            List<AnnotHandlerEventArgs> newSelectedArgs= new List<AnnotHandlerEventArgs>();
+            List<AnnotHandlerEventArgs> newSelectedArgs = new List<AnnotHandlerEventArgs>();
             FreehandAnnotArgs freehandArgs = null;
 
             if (selectedArgs == null || selectedArgs.Count == 0)
             {
-                freehandArgs = new FreehandAnnotArgs();
-                
+                freehandArgs = new FreehandAnnotArgs();
+
                 var annotate = Settings.Default.AppProperties.Annotate;
                 if (annotate != null)
                 {
@@ -387,7 +606,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                 {
                     freehandArgs.InkColor = Color.FromRgb(0x38, 0xE0, 0x2E);
                 }
-                freehandArgs.RawPointList= new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
+                freehandArgs.RawPointList = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
                 freehandArgs.Transparency = 1;
                 freehandArgs.LineWidth = 2;
 
@@ -403,7 +622,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                 freehandArgs = selectedArgs[0] as FreehandAnnotArgs;
                 foreach (var item in selectedArgs)
                 {
-                  
+
                     //if (ListPoint((item as FreehandAnnotArgs).RawPointList, ShapePoints)){
                     foreach (var point in viewContentViewModel.FillAndSign)
                     {
@@ -423,7 +642,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                 annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
                 annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
                 annotAttribsList[AnnotAttrib.NoteText] = freehandArgs.Content;
-                annotAttribsList[AnnotAttrib.Path]= freehandArgs.RawPointList;
+                annotAttribsList[AnnotAttrib.Path] = freehandArgs.RawPointList;
                 annotAttribsList[AnnotAttrib.Width] = freehandArgs.Width;
                 annotAttribsList[AnnotAttrib.Height] = freehandArgs.Height;
                 AddToPropertyPanel("ShapFillProperty", "Freehand", newSelectedArgs, annotAttribsList);
@@ -462,8 +681,8 @@ namespace PDF_Office.ViewModels.FillAndSign
 
             if (selectedArgs == null || selectedArgs.Count == 0)
             {
-                freetextArgs = new FreeTextAnnotArgs();
-       
+                freetextArgs = new FreeTextAnnotArgs();
+
                 freetextArgs.Align = TextAlignment.Left;
                 freetextArgs.BgColor = Colors.Transparent;
                 freetextArgs.FontFamily = new FontFamily(Settings.Default.AppProperties.Annotate.TextFontFamaily);
@@ -537,7 +756,7 @@ namespace PDF_Office.ViewModels.FillAndSign
         private void AddToPropertyPanel(string viewContent, string toolTag = null, List<AnnotHandlerEventArgs> annots = null, Dictionary<AnnotAttrib, object> annotAttribsList = null, AnnotAttribEvent annotAttribEvent = null, bool isUpData = false)
         {
 
-            if (annots != null&& annots.Count!=0)
+            if (annots != null && annots.Count != 0)
             {
                 propertyPanel.annotlists = annots;
                 propertyPanel.annot = annots[0];
@@ -546,11 +765,11 @@ namespace PDF_Office.ViewModels.FillAndSign
             else
             {
                 propertyPanel.annotlists = null;
-                propertyPanel.annot = null;
-                
+                propertyPanel.annot = null;
+
             }
 
-            if (annotAttribsList != null && annotAttribsList.Count != 0&&annots != null && annots.Count != 0)
+            if (annotAttribsList != null && annotAttribsList.Count != 0 && annots != null && annots.Count != 0)
             {
                 if (annots.Count > 1)
                 {
@@ -654,6 +873,114 @@ namespace PDF_Office.ViewModels.FillAndSign
             pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
             FreeHandAnnotPopMenu = pop;
         }
+        /// <summary>
+        /// 文本
+        /// </summary>
+        private void InitSelectFreeTextAnnotMenu()
+        {
+            var popMenu = new ContextMenu();
+            PopMenu pop = new PopMenu(popMenu);
+            var menuItem = new MenuItem();
+            menuItem.Name = "FreeTextCopy";
+            menuItem.Header = "复制";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextCut";
+            menuItem.Header = "剪切";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextPaste";
+            menuItem.Header = "粘贴";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextDelete";
+            menuItem.Header = "删除";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
+
+            pop.AddItem(GetSeparator());
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextColor";
+            menuItem.Header = "字体颜色";
+            menuItem.Tag = "FontColor";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextColor";
+            menuItem.Header = "填充颜色";
+            menuItem.Tag = "FillColor";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextFontFamily";
+            menuItem.Header = "字体";
+            pop.AddItem(menuItem);
+
+            var family = TextFont.GetFamily();
+
+            foreach (var item in family)
+            {
+                RadioButton familyRdioBtn = new RadioButton();
+                familyRdioBtn.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+                familyRdioBtn.Background = new SolidColorBrush(Colors.Transparent);
+                familyRdioBtn.Name = item.ValueStr;
+                familyRdioBtn.Tag = item.ValueStr;
+                familyRdioBtn.GroupName = "FontFamily";
+                familyRdioBtn.Content = item.Content;
+                pop.BindingEvent(pop.AddChild("FreeTextFontFamily", familyRdioBtn), FreeTextFontFamily_MenuCommand);
+            }
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextAglin";
+            menuItem.Header = "文本对齐";
+            pop.AddItem(menuItem);
+
+            var radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
+            radioButton.Name = "FreeTextAglinLeft";
+            radioButton.Tag = "Left";
+            radioButton.GroupName = "Aglin";
+            radioButton.Content = "左对齐";
+            pop.BindingEvent(pop.AddChild("FreeTextAglin", radioButton), FreeTextAglin_MenuCommand);
+
+            radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
+            radioButton.Name = "FreeTextAglinCenter";
+            radioButton.Tag = "Center";
+            radioButton.GroupName = "Aglin";
+            radioButton.Content = "居中对齐";
+            pop.BindingEvent(pop.AddChild("FreeTextAglin", radioButton), FreeTextAglin_MenuCommand);
+
+            radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
+            radioButton.Name = "FreeTextAglinRight";
+            radioButton.Tag = "Right";
+            radioButton.GroupName = "Aglin";
+            radioButton.Content = "右对齐";
+            pop.BindingEvent(pop.AddChild("FreeTextAglin", radioButton), FreeTextAglin_MenuCommand);
+
+            radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
+            radioButton.Name = "FreeTextAglinJustify";
+            radioButton.Tag = "Justify";
+            radioButton.GroupName = "Aglin";
+            radioButton.Content = "两端对齐";
+            pop.BindingEvent(pop.AddChild("FreeTextAglin", radioButton), FreeTextAglin_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeHandDefault";
+            menuItem.Header = "设置当前属性为默认值";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
+            FreeTextAnnotPopMenu = pop;
+        }
+
         private Separator GetSeparator()
         {
             Separator separator = new Separator();
@@ -712,12 +1039,15 @@ namespace PDF_Office.ViewModels.FillAndSign
                             {
                                 var selectedAnnot = e.AnnotEventArgsList[0];
                                 switch (selectedAnnot.EventType)
-                                {
-                                  
-
+                                {
+
+
                                     case AnnotArgsType.AnnotFreehand:
                                         e.PopupMenu = FreeHandAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
+                                        case AnnotArgsType.AnnotFreeText:
+                                        e.PopupMenu= FreeTextAnnotPopMenu.OpenMenu(selectedAnnot, sender);
+                                        break;
 
                                 }
                             }
@@ -746,8 +1076,8 @@ namespace PDF_Office.ViewModels.FillAndSign
                     else
                     {
                         if (e.PressOnSelectedText || e.CommandTarget == TargetType.ImageSelection)
-                        {
-          
+                        {
+
                             if (e.PopupMenu != null)
                             {
                                 e.Handle = true;
@@ -755,7 +1085,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                         }
                         else
                         {
-                           e.PopupMenu = ViewerContextMenu(sender);
+                            e.PopupMenu = ViewerContextMenu(sender);
                             if (e.PopupMenu != null)
                             {
                                 e.Handle = true;
@@ -845,13 +1175,13 @@ namespace PDF_Office.ViewModels.FillAndSign
         }
         private ContextMenu ViewerContextMenu(object sender)
         {
-            ContextMenu contextMenu = App.Current.FindResource("ViewerContextMenu") as ContextMenu;
-           
-            ViewerContextMenu_Loaded(contextMenu,sender);
+            ContextMenu contextMenu = App.Current.FindResource("ViewerContextMenu") as ContextMenu;
+
+            ViewerContextMenu_Loaded(contextMenu, sender);
             return contextMenu;
         }
 
-        private void ViewerContextMenu_Loaded(object sender,object e,Visibility visibility =Visibility.Collapsed)
+        private void ViewerContextMenu_Loaded(object sender, object e, Visibility visibility = Visibility.Collapsed)
         {
             ContextMenu contextMenu = sender as ContextMenu;
             if (contextMenu.Items.Count > 0)
@@ -861,17 +1191,18 @@ namespace PDF_Office.ViewModels.FillAndSign
                 CPDFBookmark list = PDFViewer.Document.GetBookmarkList().FirstOrDefault(q => q.PageIndex == index);
                 foreach (var item in contextMenu.Items)
                 {
-                    if (item is Separator separator) { 
-                    
-                    separator.Visibility = visibility;
+                    if (item is Separator separator)
+                    {
+
+                        separator.Visibility = visibility;
                     }
                     if (item is MenuItem menuItem1)
-                    {
-                        //if (menuItem1.Tag.ToString() == "DisplayAnnot" || menuItem1.Tag.ToString() == "HiddenAnnot")
-                        //{
-                        //    SetMenuItemVisibility(menuItem1, "DisplayAnnot", "HiddenAnnot", isHiddenAnnot);
-                        //}
-                        
+                    {
+                        //if (menuItem1.Tag.ToString() == "DisplayAnnot" || menuItem1.Tag.ToString() == "HiddenAnnot")
+                        //{
+                        //    SetMenuItemVisibility(menuItem1, "DisplayAnnot", "HiddenAnnot", isHiddenAnnot);
+                        //}
+
                         switch (menuItem1.Tag.ToString())
                         {
                             case "Paste":
@@ -891,53 +1222,53 @@ namespace PDF_Office.ViewModels.FillAndSign
                                 break;
 
                             case "AddAnnotation":
-                                menuItem1.Visibility = visibility;
-                             
+                                menuItem1.Visibility = visibility;
+
                                 break;
 
                             case "HiddenAnnot":
-                                menuItem1.Visibility = visibility;
-                       
+                                menuItem1.Visibility = visibility;
+
                                 break;
 
                             case "DisplayAnnot":
-                                menuItem1.Visibility = visibility;
-                    
+                                menuItem1.Visibility = visibility;
+
                                 break;
 
                             case "AddBookMark":
-                                menuItem1.Visibility = visibility;
-                     
+                                menuItem1.Visibility = visibility;
+
                                 break;
 
                             case "DelBookMark":
-                                menuItem1.Visibility = visibility;
-             
+                                menuItem1.Visibility = visibility;
+
                                 break;
 
                             case "ToolMode":
-                                menuItem1.Visibility = visibility;
-                    
+                                menuItem1.Visibility = visibility;
+
                                 break;
 
                             case "ReadModel":
-                                menuItem1.Visibility = visibility;
-                   
+                                menuItem1.Visibility = visibility;
+
                                 break;
 
                             case "UnReadModel":
-                                menuItem1.Visibility = visibility;
-                  
+                                menuItem1.Visibility = visibility;
+
                                 break;
 
                             case "ViewZoom":
-                                menuItem1.Visibility = visibility;
-              
+                                menuItem1.Visibility = visibility;
+
                                 break;
 
                             case "PageDisplay":
-                                menuItem1.Visibility = visibility;
-              
+                                menuItem1.Visibility = visibility;
+
                                 break;
 
                             case "Select":
@@ -1054,7 +1385,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                         //IsAnnotCreateReset:是否为创建注释的状态
                         if (e.IsAnnotCreateReset == false)
                         {
-                           
+
                             GetSelectedAnnots(e);
                             //记录这次选中的注释,之后创建注释会跟随上次选中注释的属性值
                             //PDFViewer.SetToolParam(annot);
@@ -1250,11 +1581,11 @@ namespace PDF_Office.ViewModels.FillAndSign
             UnBindingPDFViewerHandler();
             ContextMenu contextMenu = App.Current.FindResource("ViewerContextMenu") as ContextMenu;
 
-            ViewerContextMenu_Loaded(contextMenu, null,Visibility.Visible);
+            ViewerContextMenu_Loaded(contextMenu, null, Visibility.Visible);
             viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
             PDFViewer.SetMouseMode(MouseModes.PanTool);
-            ShowPropertyPanel(false);
-           
+            ShowPropertyPanel(false);
+
         }
 
         public void OnNavigatedTo(NavigationContext navigationContext)
@@ -1262,7 +1593,7 @@ namespace PDF_Office.ViewModels.FillAndSign
             navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             BindingPDFViewerHandler();
-            HookShapeIsCheck=true;
+            HookShapeIsCheck = true;
             InitCheckedEvent("RbtnTick");
             IsEdit = false;
         }

+ 6 - 0
PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs

@@ -19,6 +19,8 @@ using PDF_Office.ViewModels.Tools;
 using Microsoft.Office.Interop.Excel;
 using Point = System.Windows.Point;
 using static Dropbox.Api.UsersCommon.AccountType;
+using PDF_Office.Model.AnnotPanel;
+using PDFSettings;
 
 namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
 {
@@ -39,6 +41,10 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
             }
         }
 
+        private void InitColorItems()
+        {
+        }
+
         private Brush selectColor = new SolidColorBrush(Colors.GreenYellow);
         public Brush SelectColor
         {

+ 22 - 0
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -32,6 +32,27 @@ namespace PDF_Office.ViewModels.PageEdit
 {
     public class PageEditContentViewModel : BindableBase, INavigationAware
     {
+        #region 文案
+
+        private string T_title;
+
+        public string T_Title
+        {
+            get { return T_title; }
+            set
+            {
+                SetProperty(ref T_title, value);
+            }
+        }
+
+
+        private void InitString()
+        {
+            T_Title = App.MainPageLoader.GetString("Thumbnails_Title");
+        }
+
+        #endregion
+
 
         private CPDFViewer PDFViewer;
 
@@ -451,6 +472,7 @@ namespace PDF_Office.ViewModels.PageEdit
             CacheFilePath.Instance.PropertyChanged += Instance_PropertyChanged;
 
             RefreshPageRangeItem();
+            InitString();
         }
 
         #region 事件

+ 2 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SnapshotEditMenuViewModel.cs

@@ -28,6 +28,8 @@ using Directory = System.IO.Directory;
 using System.Drawing.Imaging;
 using Microsoft.Office.Interop.Word;
 using static Dropbox.Api.Sharing.ListFileMembersIndividualResult;
+using Prism.Regions;
+using System.Windows.Input;
 
 namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 {

+ 5 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -42,6 +42,9 @@ namespace PDF_Office.ViewModels.Tools
             propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
             propertyPanel.AnnotTypeChanged -= AnnotPropertyPanel_AnnotTypeChanged;
             propertyPanel.AnnotTypeChanged += AnnotPropertyPanel_AnnotTypeChanged;
+            //快捷键
+            KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
+            KeyEventsHelper.KeyDown += ShortCut_KeyDown;
         }
 
         private void UnBindingEvent()
@@ -49,6 +52,8 @@ namespace PDF_Office.ViewModels.Tools
             propertyPanel.DataChanged -= AnnotPropertyPanel_DataChanged;
             propertyPanel.DefaultStored -= AnnotProperty_DefaultStored;
             propertyPanel.AnnotTypeChanged -= AnnotPropertyPanel_AnnotTypeChanged;
+            //快捷盘解绑
+            KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
         }
 
         private void BindingPDFViewerHandler()

+ 16 - 3
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -27,6 +27,7 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
+using System.Windows.Documents;
 using System.Windows.Forms;
 using System.Windows.Input;
 using System.Windows.Media;
@@ -946,8 +947,6 @@ namespace PDF_Office.ViewModels.Tools
 
         #region 菜单
 
-
-
         /// <summary>
         /// 空白处-右键菜单-添加注释
         /// </summary>
@@ -1077,11 +1076,25 @@ namespace PDF_Office.ViewModels.Tools
                         break;
 
                     case "StickyNote"://便签
+
                         StickyAnnotArgs stickyAnnotArgs = (StickyAnnotArgs)GetStickyNote();
                         //stickyAnnotArgs.ClientRect = annotCommand.TextRect;
-                        stickyAnnotArgs.ClientRect = new Rect(annotCommand.TextRect.X, annotCommand.TextRect.Y - annotCommand.TextRect.Height, annotCommand.TextRect.Width, annotCommand.TextRect.Height);
+                        List<TextSelectNode> textSelectNodes = PDFViewer.GetSelectTextInfo();
+
+                        stickyAnnotArgs.ClientRect = new Rect(textSelectNodes[0].StartPoint.X, annotCommand.TextRect.Y - annotCommand.TextRect.Height, annotCommand.TextRect.Width, annotCommand.TextRect.Height);
                         stickyAnnotArgs.StickyNote = annotCommand.Text;
                         PDFViewer.CreatePageAnnot(annotCommand.PageIndex, stickyAnnotArgs);
+
+                        customStickyPopup = new StickyNotePopup();
+                        PDFViewer.SetStickyNotePop(customStickyPopup);
+
+                        //customStickyPopup.GetCurrentAnnot = stickyAnnotArgs;
+                        //customStickyPopup.GetPDFViewer = PDFViewer;
+                        //stickyAnnotArgs.Author = Settings.Default.AppProperties.Description.Author;
+                        PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                        PDFViewer.SetToolParam(stickyAnnotArgs);
+
+                        PDFViewer.SetMouseMode(MouseModes.PanTool);
                         break;
 
                     case "Rect"://矩形

+ 12 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs

@@ -252,6 +252,18 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        private string _strAnnotToolChecked = "";
+
+        public string StrAnnotToolChecked
+        {
+            get { return _strAnnotToolChecked; }
+            set
+            {
+                SetProperty(ref _strAnnotToolChecked, value);
+            }
+        }
+
+        
         #endregion 注释工具
 
         #endregion 属性

+ 121 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -36,6 +36,7 @@ using System.Windows.Forms;
 using System.Windows.Input;
 using System.Windows.Media;
 using ContextMenu = System.Windows.Controls.ContextMenu;
+using KeyEventArgs = System.Windows.Input.KeyEventArgs;
 using MenuItem = System.Windows.Controls.MenuItem;
 
 namespace PDF_Office.ViewModels.Tools
@@ -106,7 +107,7 @@ namespace PDF_Office.ViewModels.Tools
 
         private void Esc_KeyDown()
         {
-            PDFViewer.SetMouseMode(MouseModes.None);
+            //PDFViewer.SetMouseMode(MouseModes.None);
         }
 
         private void Hand_Click(object obj)
@@ -598,6 +599,124 @@ namespace PDF_Office.ViewModels.Tools
 
         #endregion 阅读页右键菜单
 
+        #region 快捷键
+
+        private void ShortCut_KeyDown(object sender, KeyEventArgs e)
+        {
+            if(KeyEventsHelper.IsSingleKey(Key.Escape))
+            {
+                PDFViewer.SetMouseMode(MouseModes.None);
+                StrAnnotToolChecked = "";
+
+            }
+            else if(KeyEventsHelper.IsModifierKey(ModifierKeys.Shift, Key.None))
+            {
+                //按住Shift等比缩放
+
+            }
+
+            AnnotToolCtrlAltKey();
+        }
+
+        /// <summary>
+        /// 按下Ctrl + Alt + 序列键,响应注释工具
+        /// </summary>
+        private void AnnotToolCtrlAltKey()
+        {
+
+            var tuple = GetCtrlAltKey();
+            if(tuple != null)
+            {
+                if (tuple.Item1 == Key.L)
+                    BtnLinkIsChecked = false;
+
+                AnnotHandlerEventArgs annotArgs = null;
+                StrAnnotToolChecked = tuple.Item2;
+                FindAnnotTypeKey(tuple.Item2, ref annotArgs);
+                if (annotArgs != null)
+                {
+                    annotArgs.Author = Settings.Default.AppProperties.Description.Author;
+                    PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                    PDFViewer.SetToolParam(annotArgs);
+                    PDFViewer.ToolManager.EnableClickCreate = false;
+                }
+            }
+
+        }
+
+        private Tuple<Key, string> GetCtrlAltKey()
+        {
+            Dictionary<Key, bool> AnnotToolDir = new Dictionary<Key, bool>();
+            AnnotToolDir.Add(Key.H, KeyEventsHelper.IsModifierKey(ModifierKeys.Control | ModifierKeys.Alt, Key.H));
+            AnnotToolDir.Add(Key.U, KeyEventsHelper.IsModifierKey(ModifierKeys.Control | ModifierKeys.Alt, Key.U));
+            AnnotToolDir.Add(Key.S, KeyEventsHelper.IsModifierKey(ModifierKeys.Control | ModifierKeys.Alt, Key.S));
+            AnnotToolDir.Add(Key.P, KeyEventsHelper.IsModifierKey(ModifierKeys.Control | ModifierKeys.Alt, Key.P));
+            AnnotToolDir.Add(Key.E, KeyEventsHelper.IsModifierKey(ModifierKeys.Control | ModifierKeys.Alt, Key.E));
+            AnnotToolDir.Add(Key.T, KeyEventsHelper.IsModifierKey(ModifierKeys.Control | ModifierKeys.Alt, Key.T));
+            AnnotToolDir.Add(Key.N, KeyEventsHelper.IsModifierKey(ModifierKeys.Control | ModifierKeys.Alt, Key.N));
+            AnnotToolDir.Add(Key.R, KeyEventsHelper.IsModifierKey(ModifierKeys.Control | ModifierKeys.Alt, Key.R));
+            AnnotToolDir.Add(Key.O, KeyEventsHelper.IsModifierKey(ModifierKeys.Control | ModifierKeys.Alt, Key.O));
+            AnnotToolDir.Add(Key.A, KeyEventsHelper.IsModifierKey(ModifierKeys.Control | ModifierKeys.Alt, Key.A));
+            AnnotToolDir.Add(Key.L, KeyEventsHelper.IsModifierKey(ModifierKeys.Control | ModifierKeys.Alt, Key.L));
+
+            Key key = Key.None;
+            foreach (var item in AnnotToolDir.Keys)
+            {
+                if (AnnotToolDir[item] == true)
+                {
+                    key = item;
+                    break;
+                }
+            }
+
+            if (key == Key.None)
+                return null;
+
+            var tag = "";
+            if (key == Key.H || key == Key.U || key == Key.S)
+            {
+                var str = PDFViewer.GetSelectedText();
+                if (string.IsNullOrEmpty(str) == false)
+                {
+                    if (key == Key.H)
+                        tag = "HighLight";
+                    else if (key == Key.U)
+                        tag = "UnderLine";
+                    else if (key == Key.S)
+                        tag = "Strikeout";
+                }
+                else
+                {
+                    return null;
+                }
+            }
+            else
+            {
+                if (AnnotToolDir[Key.P])
+                    tag = "Freehand";
+                else if (AnnotToolDir[Key.T])
+                    tag = "Freetext";
+                else if (AnnotToolDir[Key.N])
+                    tag = "StickyNote";
+                else if (AnnotToolDir[Key.R])
+                    tag = "Rect";
+                else if (AnnotToolDir[Key.O])
+                    tag = "Circle";
+                else if (AnnotToolDir[Key.A])
+                    tag = "Arrow";
+                else if (AnnotToolDir[Key.L])
+                    tag = "Line";
+            }
+
+            if (tag == "")
+                return null;
+
+            return new Tuple<Key, string>(key, tag);
+        }
+
+        #endregion 快捷键
+
+
         #region Navigation
 
         public bool IsNavigationTarget(NavigationContext navigationContext)
@@ -607,6 +726,7 @@ namespace PDF_Office.ViewModels.Tools
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
+            StrAnnotToolChecked = "";
             UnBindingPDFViewerHandler();
             UnBindingEvent();
         }

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

@@ -28,6 +28,9 @@ using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySetti
 using PDF_Office.Views.PropertyPanel.AnnotPanel;
 using System.Linq;
 using System.Text;
+using PDF_Office.Views.Tools;
+using System.Windows.Input;
+using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
 
 namespace PDF_Office.ViewModels
 {
@@ -155,6 +158,7 @@ namespace PDF_Office.ViewModels
                 SetProperty(ref T_share, value);
             }
         }
+
         private string T_properties;
 
         public string T_Properties
@@ -166,7 +170,6 @@ namespace PDF_Office.ViewModels
             }
         }
 
-
         private void InitStirng()
         {
             T_File = App.MainPageLoader.GetString("ViewTopToolbar_File");
@@ -182,7 +185,9 @@ namespace PDF_Office.ViewModels
             T_Share = App.MainPageLoader.GetString("ViewTopToolbar_Share");
             T_Properties = App.MainPageLoader.GetString("ViewTopToolbar_Properties");
         }
-        #endregion
+
+        #endregion 文案
+
         #region 属性、变量
 
         public OpenFileInfo OpenFileInfo = null;
@@ -682,8 +687,8 @@ namespace PDF_Office.ViewModels
 
         public DelegateCommand<string> HelpCommand { get; set; }
 
-
         public DelegateCommand CreateBlankFileCommand { get; set; }
+
         #endregion 命令
 
         public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
@@ -775,21 +780,27 @@ namespace PDF_Office.ViewModels
                 case "Guid":
                     //TODO 打开内嵌文档
                     break;
+
                 case "Online":
                     url = @"https://www.pdfreaderpro.com/windows/help";
                     break;
+
                 case "More":
                     url = @"https://www.pdfreaderpro.com/product?utm_source=MacApp&utm_campaign=ProductLink&utm_medium=PdfProduct";
                     break;
+
                 case "Template":
                     url = @"https://www.pdfreaderpro.com/templates?utm_source=MacApp&utm_campaign=TemplatesLink&utm_medium=PdfTemplates";
                     break;
+
                 case "Blog":
                     //TODO:显示订阅电子报弹窗
                     break;
+
                 case "ComPDF":
                     url = @"https://www.compdf.com/?utm_source=macapp&utm_medium=pdfmac&utm_campaign=compdfkit-promp";
                     break;
+
                 case "FeedBack":
                     //调用邮箱 发送邮件
                     StringBuilder sr = new StringBuilder();
@@ -797,6 +808,7 @@ namespace PDF_Office.ViewModels
 
                     System.Diagnostics.Process.Start(string.Format("mailto:support@pdfreaderpro.com?subject={0}", sr));
                     break;
+
                 default:
                     break;
             }
@@ -1481,6 +1493,10 @@ namespace PDF_Office.ViewModels
                 CheckHaveAllPermission();
             }
             isOpenFile = true;
+
+            //快捷键
+            KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
+            KeyEventsHelper.KeyDown += ShortCut_KeyDown;
         }
 
         public bool IsNavigationTarget(NavigationContext navigationContext)
@@ -1499,12 +1515,67 @@ namespace PDF_Office.ViewModels
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
+            KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
         }
 
         #endregion Navigate
 
         #region 方法
 
+        /// <summary>
+        /// 快捷键
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        /// <exception cref="NotImplementedException"></exception>
+        private void ShortCut_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
+        {
+            if (KeyEventsHelper.IsSingleKey(System.Windows.Input.Key.Escape))
+            {
+                if (mainViewModel.IsBookMode == true)
+                {
+                    UnReadModel();
+                }
+                //内容选择 退出
+                if (PDFViewer.MouseMode != MouseModes.PanTool)
+                {
+                    if (region.Regions.ContainsRegionWithName(ToolsBarContentRegionName))
+                    {
+                        var views = region.Regions[ToolsBarContentRegionName].Views;
+                        var model = views.FirstOrDefault(q => q is AnnotToolContent);
+                        if (model is AnnotToolContent annotToolContent)
+                        {
+                            AnnotToolContentViewModel toolContentViewModel = annotToolContent.DataContext as AnnotToolContentViewModel;
+                            if (annotToolContent.BtnSelecttool.IsChecked == true)
+                            {
+                                if (toolContentViewModel.SnapshotEditMenuViewModel.SnapToolArgs != null)
+                                {
+                                    toolContentViewModel.SnapshotEditMenuViewModel.SnapToolArgs.ReSnapshot();
+                                    annotToolContent.BtnSelecttool.IsChecked = false;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            if (KeyEventsHelper.IsModifierKey(ModifierKeys.Control, Key.C))
+            {
+                if (region.Regions.ContainsRegionWithName(ToolsBarContentRegionName))
+                {
+                    var views = region.Regions[ToolsBarContentRegionName].Views;
+                    var model = views.FirstOrDefault(q => q is AnnotToolContent);
+                    if (model is AnnotToolContent annotToolContent)
+                    {
+                        AnnotToolContentViewModel toolContentViewModel = annotToolContent.DataContext as AnnotToolContentViewModel;
+                        if (annotToolContent.BtnSelecttool.IsChecked == true)
+                        {
+                            toolContentViewModel.SnapshotEditMenuViewModel.SnapCopyCommand.Execute();
+                        }
+                    }
+                }
+            }
+        }
+
         /// <summary>
         /// 视图面板  切换分屏模式
         /// </summary>
@@ -1754,7 +1825,6 @@ namespace PDF_Office.ViewModels
                         }
                         catch
                         {
-
                         }
                         PDFViewer.UndoManager.CanSave = false;
                         SecurityInfo.IsPasswordChanged = false;
@@ -1766,7 +1836,7 @@ namespace PDF_Office.ViewModels
                     }
                 }
 
-                bool  result = PDFViewer.Document.WriteToLoadedPath();
+                bool result = PDFViewer.Document.WriteToLoadedPath();
                 if (result)
                 {
                     PDFViewer.UndoManager.CanSave = false;

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

@@ -10,7 +10,6 @@
     xmlns:model="clr-namespace:PDF_Office.Model.BOTA"
     xmlns:mainPageLoader="clr-namespace:PDF_Office.Strings.MainPage"
     d:DataContext="{d:DesignInstance Type=bota:OutLineControlViewModel}"
-    Loaded="UserControl_Loaded"
     mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
@@ -28,6 +27,7 @@
             <Grid x:Name="Header">
                 <TextBlock
                     x:Name="TxtTitle"
+                    Text="{Binding T_Title}"
                     Margin="16,0,0,0"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
@@ -81,14 +81,17 @@
                                 </ContextMenu.ItemContainerStyle>
                                 <MenuItem
                                     Name="MenuExpandAll"
+                                    Header="{Binding T_Expand}"
                                     Command="{Binding ExpandAllCommand}"
                                     CommandParameter="{Binding Outlinelist}" />
                                 <MenuItem
                                     Name="MenuCollapseAll"
+                                    Header="{Binding T_Collapse}"
                                     Command="{Binding CollapseAllCommand}"
                                     CommandParameter="{Binding Outlinelist}"/>
                                 <MenuItem
                                     Name="MenuDeleteAll"
+                                    Header="{Binding T_RemoveAll}"
                                     Command="{Binding DeleteAllCommand}" />
                             </ContextMenu>
                         </customcontrol:PathButton.ContextMenu>

+ 0 - 12
PDF Office/Views/BOTA/OutLineControl.xaml.cs

@@ -59,10 +59,6 @@ namespace PDF_Office.Views.BOTA
             InitializeComponent();
         }
 
-        private void LoadedLangText()
-        {
-        }
-
         private void BtnMore_Click(object sender, RoutedEventArgs e)
         {
             MenuMore.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
@@ -485,13 +481,5 @@ namespace PDF_Office.Views.BOTA
                 OutlineView.Focus();
             }
         }
-
-        private void UserControl_Loaded(object sender, RoutedEventArgs e)
-        {
-            TxtTitle.Text = App.MainPageLoader.GetString("Outline_Title");
-            MenuExpandAll.Header = App.MainPageLoader.GetString("Outline_Expand");
-            MenuCollapseAll.Header = App.MainPageLoader.GetString("Outline_Collapse");
-            MenuDeleteAll.Header = App.MainPageLoader.GetString("Outline_RemoveAll");
-        }
     }
 }

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

@@ -302,7 +302,7 @@
                         FontSize="14"
                         FontWeight="SemiBold"
                         LineHeight="20"
-                        Text="Thumbnails" />
+                        Text="{Binding T_Title}" />
                     <ToggleButton
                         Name="TbnTwoLine"
                         Width="32"

+ 9 - 1
PDF Office/Views/Tools/AnnotToolContent.xaml

@@ -22,7 +22,7 @@
             <ResourceDictionary.MergedDictionaries>
                 <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
-
+            <local:AnnotToolIsCheckedConvert x:Key="AnnotToolIsCheckedConvert"/>
             <SolidColorBrush x:Key="PageBackGround" Color="#FFFCFDFF" />
             <SolidColorBrush x:Key="Button.Static.Background" Color="Transparent" />
             <SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070" />
@@ -126,6 +126,7 @@
                     Click="BtnTool_Click"
                     Command="{Binding MyToolsCommand}"
                     CommandParameter="{Binding ElementName=BtnHighlight}"
+                    IsChecked="{Binding StrAnnotToolChecked,Converter={StaticResource AnnotToolIsCheckedConvert},ConverterParameter=HighLight}"
                     Style="{StaticResource ToggleBtnViewModeStyle}"
                     Tag="HighLight">
                     <Grid VerticalAlignment="Center">
@@ -153,6 +154,7 @@
                     Click="BtnTool_Click"
                     Command="{Binding MyToolsCommand}"
                     CommandParameter="{Binding ElementName=BtnUnderLine}"
+                    IsChecked="{Binding StrAnnotToolChecked,Converter={StaticResource AnnotToolIsCheckedConvert},ConverterParameter=UnderLine}"
                     Style="{StaticResource ToggleBtnViewModeStyle}"
                     Tag="UnderLine">
                     <Grid Width="20" Height="20">
@@ -181,6 +183,7 @@
                     Click="BtnTool_Click"
                     Command="{Binding MyToolsCommand}"
                     CommandParameter="{Binding ElementName=BtnSuiggly}"
+                    IsChecked="{Binding StrAnnotToolChecked,Converter={StaticResource AnnotToolIsCheckedConvert},ConverterParameter=Squiggly}"
                     Style="{StaticResource ToggleBtnViewModeStyle}"
                     Tag="Squiggly"
                     Visibility="Collapsed">
@@ -204,6 +207,7 @@
                     Click="BtnTool_Click"
                     Command="{Binding MyToolsCommand}"
                     CommandParameter="{Binding ElementName=BtnDeleteLine}"
+                    IsChecked="{Binding StrAnnotToolChecked,Converter={StaticResource AnnotToolIsCheckedConvert},ConverterParameter=Strikeout}"
                     Style="{StaticResource ToggleBtnViewModeStyle}"
                     Tag="Strikeout">
                     <Grid Width="20" Height="20">
@@ -228,6 +232,7 @@
                     Click="BtnTool_Click"
                     Command="{Binding MyToolsCommand}"
                     CommandParameter="{Binding ElementName=BtnFreeHand}"
+                    IsChecked="{Binding StrAnnotToolChecked,Converter={StaticResource AnnotToolIsCheckedConvert},ConverterParameter=Freehand}"
                     Style="{StaticResource ToggleBtnViewModeStyle}"
                     Tag="Freehand">
                     <Grid>
@@ -256,6 +261,7 @@
                     Click="BtnTool_Click"
                     Command="{Binding MyToolsCommand}"
                     CommandParameter="{Binding ElementName=BtnTextBox}"
+                    IsChecked="{Binding StrAnnotToolChecked,Converter={StaticResource AnnotToolIsCheckedConvert},ConverterParameter=Freetext}"
                     Style="{StaticResource ToggleBtnViewModeStyle}"
                     Tag="Freetext">
                     <Path
@@ -269,6 +275,7 @@
                     Click="BtnTool_Click"
                     Command="{Binding MyToolsCommand}"
                     CommandParameter="{Binding ElementName=BtnNote}"
+                    IsChecked="{Binding StrAnnotToolChecked,Converter={StaticResource AnnotToolIsCheckedConvert},ConverterParameter=StickyNote}"
                     Style="{StaticResource ToggleBtnViewModeStyle}"
                     Tag="StickyNote">
                     <Grid Width="20" Height="20">
@@ -285,6 +292,7 @@
                     Click="BtnTool_Click"
                     Command="{Binding MyToolsCommand}"
                     CommandParameter="{Binding ElementName=BtnRectangle}"
+                    IsChecked="{Binding StrAnnotToolChecked,Converter={StaticResource AnnotToolIsCheckedConvert},ConverterParameter=Rect}"
                     Style="{StaticResource ToggleBtnViewModeStyle}"
                     Tag="Rect">
                     <Path

+ 29 - 1
PDF Office/Views/Tools/AnnotToolContent.xaml.cs

@@ -3,6 +3,7 @@ using PDF_Office.CustomControl;
 using PDF_Office.ViewModels.Tools;
 using System;
 using System.Collections.Generic;
+using System.Globalization;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -18,6 +19,33 @@ using System.Windows.Shapes;
 
 namespace PDF_Office.Views.Tools
 {
+    public class AnnotToolIsCheckedConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if(value != null && parameter != null && value is string && parameter is string)
+            {
+                if((string)value == (string)parameter)
+                    return true;
+            }
+
+            return false;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if(value != null && value is bool)
+            {
+                if((bool)value)
+                {
+                    return parameter;
+                }
+            }
+
+            return "";
+
+        }
+    }
     /// <summary>
     /// AnnotToolContent.xaml 的交互逻辑
     /// </summary>
@@ -58,7 +86,7 @@ namespace PDF_Office.Views.Tools
 
             if (keepBtn != null)
             {
-                ClearSelectedToolPanel(keepBtn);
+               // ClearSelectedToolPanel(keepBtn);
             }
         }
 

+ 4 - 2
PDF Office/Views/ViewContent.xaml.cs

@@ -140,7 +140,10 @@ namespace PDF_Office.Views
                     }
                     else
                     {
-                        viewModel.UnReadModel();
+                        if (viewModel.mainViewModel.IsBookMode == true)
+                        {
+                            viewModel.UnReadModel();
+                        }
                     }
                 }
             }
@@ -160,7 +163,6 @@ namespace PDF_Office.Views
 
         private void ContentControl_SizeChanged(object sender, SizeChangedEventArgs e)
         {
-
         }
 
         private void MenuRecent_Loaded(object sender, RoutedEventArgs e)