Sfoglia il codice sorgente

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

liuaoran 1 settimana fa
parent
commit
96f599c5de
1 ha cambiato i file con 18 aggiunte e 3 eliminazioni
  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