Parcourir la source

阅读模式esc退出问题修复

liyijie il y a 1 an
Parent
commit
c32bb0ee40

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

@@ -224,6 +224,9 @@ namespace PDF_Master.ViewModels.Tools
         // 是否处于打印
         private bool IsPasteShape = false;
 
+        //判断注释是否在拖拉创建中
+        public bool IsCreateAnnot = false;
+
         public string PropertyRegionName { get; set; }
         private IEventAggregator events;
         public IDialogService dialogs;

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

@@ -1745,6 +1745,7 @@ namespace PDF_Master.ViewModels.Tools
                                     if (PDFViewer.ToolManager.HasTool)
                                     {
                                         PDFViewer.RemoveTool(false);
+                                        IsCreateAnnot = true;
                                     }
                                     else
                                     {

+ 20 - 4
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -2089,10 +2089,8 @@ namespace PDF_Master.ViewModels
         {
             if (KeyEventsHelper.IsSingleKey(System.Windows.Input.Key.Escape))
             {
-                if (mainViewModel.IsBookMode == true)
-                {
-                    Off_ReadModel();
-                }
+                //判断是不是不是注释工具下
+                bool isunannotTool = true;
                 //内容选择 退出
                 if (PDFViewer.MouseMode != MouseModes.PanTool)
                 {
@@ -2106,10 +2104,28 @@ namespace PDF_Master.ViewModels
                                 toolContentViewModel.SnapshotEditMenuViewModel.SnapToolArgs.ReSnapshot();
                                 annotToolContent.BtnSelecttool.IsChecked = false;
                                 PDFViewer.SetMouseMode(MouseModes.PanTool);
+                                isunannotTool = false;
+
+                            }
+                        }
+                        else {
+
+                            if (toolContentViewModel!= null)
+                            {
+                                if (toolContentViewModel.IsCreateAnnot) {
+                                    isunannotTool = false;
+                                    toolContentViewModel.IsCreateAnnot=false;
+                                }
+
                             }
                         }
                     }
                 }
+
+                if (mainViewModel.IsBookMode == true&& isunannotTool)
+                {
+                    Off_ReadModel();
+                }
             }
             if (KeyEventsHelper.IsModifierKey(ModifierKeys.Control, Key.C))
             {