Browse Source

ComPDFKit.Tool(win)-补充滑动条改变事件

liyijie 3 months ago
parent
commit
3fc7b9b75c

+ 1 - 1
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.xaml

@@ -12,7 +12,7 @@
              >
     <ScrollViewer Focusable="False" CanContentScroll="True"
                   HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
-                  MouseUp="ScrollViewer_MouseUp" MouseDown="ScrollViewer_MouseDown">
+                  MouseUp="ScrollViewer_MouseUp" MouseDown="ScrollViewer_MouseDown" ScrollChanged="ScrollViewer_ScrollChanged">
         <compdfkitviewer:CPDFViewer x:Name="PDFViewer">
 
         </compdfkitviewer:CPDFViewer>

+ 6 - 0
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.xaml.cs

@@ -110,6 +110,7 @@ namespace ComPDFKit.Tool
         public event EventHandler<MouseEventObject> MouseLeftButtonUpHandler;
         public event EventHandler<MouseEventObject> MouseMoveHandler;
         public event EventHandler<MouseEventObject> MouseRightButtonDownHandler;
+        public event EventHandler<ScrollChangedEventArgs> ScrollChangedHandler;
         public event EventHandler DrawChanged;
         public event EventHandler DocumentModifiedChanged;
 
@@ -1075,5 +1076,10 @@ namespace ComPDFKit.Tool
         {
 
         }
+
+        private void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
+        {
+            ScrollChangedHandler?.Invoke(this, e);
+        }
     }
 }