瀏覽代碼

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

liuaoran 1 周之前
父節點
當前提交
96f599c5de
共有 1 個文件被更改,包括 18 次插入3 次删除
  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