Parcourir la source

ComPDFKit.Tools(win) -加载时禁止鼠标点击和抬起

liuaoran il y a 1 semaine
Parent
commit
96f599c5de
1 fichiers modifiés avec 18 ajouts et 3 suppressions
  1. 18 3
      Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.xaml.cs

+ 18 - 3
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.xaml.cs

@@ -14,6 +14,7 @@ using ComPDFKitViewer.Widget;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
@@ -319,6 +320,10 @@ namespace ComPDFKit.Tool
 
         protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
         {
+            if (PDFViewer.IsRendering)
+            {
+                return;
+            }
             if (isContinueCreateTextEdit)
             {
                 if (lastSelectedRect != null)
@@ -578,6 +583,11 @@ namespace ComPDFKit.Tool
 
         protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
         {
+            if (!PDFViewer.IsRendering)
+            {
+               // return;
+            }
+
             if (PDFViewer == null || PDFViewer.CurrentRenderFrame == null)
             {
                 return;
@@ -610,8 +620,13 @@ namespace ComPDFKit.Tool
             ReleaseMouseCapture();
         }
 
-        protected override void OnMouseMove(MouseEventArgs e)
-        {
+        protected override async void OnMouseMove(MouseEventArgs e)
+        { 
+
+            if (PDFViewer.IsRendering)
+            {
+                return; 
+            }
             if (PDFViewer == null || PDFViewer.CurrentRenderFrame == null)
             {
                 return;
@@ -870,7 +885,7 @@ namespace ComPDFKit.Tool
                             default:
                                 break;
                         }
-                    } 
+                    }
                 }
             }
             else