Browse Source

注释 - 优化注释工具

chenrongqian@kdanmobile.com 1 year ago
parent
commit
848539af00

+ 8 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs

@@ -262,6 +262,14 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             {
                 PropertyPanel.InvokeToMyTools(AnnotArgsType.AnnotFreehand, CurrenFreeHandAnnot);
                 IsPen = true;;
+                if (CurrenFreeHandAnnot is FreehandAnnotArgs)
+                {
+                    BasicVm.AnnotTypeTitle = "画笔";
+                }
+                else
+                {
+                    BasicVm.AnnotTypeTitle = "橡皮擦";
+                }
             }
         }
 

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

@@ -310,12 +310,10 @@ namespace PDF_Office.ViewModels.Tools
             {
                 if (annot.EventType == AnnotArgsType.AnnotStamp)
                 {
-                    GetStamp();
                     StrAnnotToolChecked = "Stamp";
                 }
                 else
                 {
-                    GetFreehand();
                     StrAnnotToolChecked = "";
                 }
             }

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

@@ -339,8 +339,6 @@ namespace PDF_Office.ViewModels.Tools
         //图章
         public DelegateCommand<object> StampExportPicture_MenuCommand { get; set; }
 
-        //ESC
-        public DelegateCommand EscCommand { get; set; }
 
         //链接
         public DelegateCommand<object> Link_MenuCommand { get; set; }

+ 5 - 30
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -57,6 +57,8 @@ namespace PDF_Office.ViewModels.Tools
             InitPopMenu();
             SubscribeEvent();
         }
+
+        //事件聚合器
         private void SubscribeEvent()
         {
             Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
@@ -82,8 +84,6 @@ namespace PDF_Office.ViewModels.Tools
             AddBookMarkCommand = new DelegateCommand(AddBookMark_Click);
             PropertyRegionName = Guid.NewGuid().ToString();
             HandCommand = new DelegateCommand<object>(Hand_Click);
-            //ESC
-            EscCommand = new DelegateCommand(Esc_KeyDown);
 
             #region 注释 - 右键菜单
 
@@ -111,37 +111,12 @@ namespace PDF_Office.ViewModels.Tools
             #endregion 注释 - 右键菜单
         }
 
-        private void Esc_KeyDown()
-        {
-            //PDFViewer.SetMouseMode(MouseModes.None);
-        }
-
         private void Hand_Click(object obj)
         {
-            if (obj is WrapPanel wrapPanel)
+            HandToolIsCheckedEvent(BtnHandIsChecked);
+            if (BtnHandIsChecked)
             {
-                foreach (var item in wrapPanel.Children)
-                {
-                    if (item is CustomIconToggleBtn customIconToggle)
-                    {
-                        if (customIconToggle.Name == "BtnHand")
-                        {
-                            HandToolIsCheckedEvent((bool)customIconToggle.IsChecked);
-                        }
-                        //if (customIconToggle.Name == "BtnHand")
-                        //{
-                        //    BtnHandIsChecked = (bool)customIconToggle.IsChecked;
-                        //}
-                        if (BtnHandIsChecked)
-                        {
-                            if (customIconToggle.Name != "BtnShowAnnot" && customIconToggle.Name != "BtnHand")
-                            {
-                                customIconToggle.IsChecked = false;
-                            }
-                        }
-                    }
-                }
-
+                StrAnnotToolChecked = "";
                 viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
             }
         }

File diff suppressed because it is too large
+ 26 - 63
PDF Office/Views/Tools/AnnotToolContent.xaml