Kaynağa Gözat

ComPDFKit(win) - 添加注释更新列表

weixiangjie 7 ay önce
ebeveyn
işleme
fbd05af339

+ 10 - 0
Demo/Examples/Compdfkit_Tools/Annotation/AnnotationControl/AnnotationControl.xaml.cs

@@ -223,6 +223,16 @@ baseWidget.GetAnnotData().Annot);
             panelState.PropertyChanged += PanelState_PropertyChanged;
             PDFViewControl.PDFViewTool.GetCPDFViewer().UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
             PDFViewControl.PDFViewTool.GetCPDFViewer().UndoManager.PropertyChanged += UndoManager_PropertyChanged;
+            PDFAnnotationControl.ClearAnnotationBar -= PdfAnnotationControl_ClearAnnotationBar;
+            PDFViewControl.MouseLeftButtonUpHandler += PDFToolManager_MouseLeftButtonUpHandler;
+        }
+        
+        private void PDFToolManager_MouseLeftButtonUpHandler(object sender, MouseEventObject e)
+        {
+            if (e.IsCreate)
+            {
+                OnAnnotEditHandler?.Invoke(this, EventArgs.Empty);
+            }
         }
 
         private void PDFViewControl_MouseRightButtonDownHandler(object sender, ComPDFKit.Tool.MouseEventObject e)

+ 8 - 24
Demo/Examples/Compdfkit_Tools/Measure/MeasureControl.xaml.cs

@@ -47,33 +47,14 @@ namespace Compdfkit_Tools.Measure
         private CPDFAnnotation currentAnnot = null;
 
         public event EventHandler ExpandEvent;
+        public event EventHandler OnAnnotEditHandler;
+
 
         public MeasureControl()
         {
             InitializeComponent();
-            //MeasureSetting.MeasureChanged += MeasureSetting_MeasureChanged;
-        }
-
-        //private void MeasureSetting_MeasureChanged(object sender, MeasureEventArgs e)
-        //{
-        //    InfoPanel.SetMeasureType(e.Type);
-        //    InfoPanel.SetMeasureInfo(e);
-
-        //    switch (e.Type)
-        //    {
-        //        case CPDFMeasureType.CPDF_DISTANCE_MEASURE:
-        //        case CPDFMeasureType.CPDF_PERIMETER_MEASURE:
-        //            SettingPanel.ShowAreaAndLength(Visibility.Collapsed);
-        //            break;
-        //        case CPDFMeasureType.CPDF_AREA_MEASURE:
-        //            SettingPanel.ShowAreaAndLength(Visibility.Visible);
-        //            break;
-        //        default:
-        //            break;
-        //    }
-
-        //    SettingPanel.BindMeasureSetting(e);
-        //}
+        }
+        
         #region Init PDFViewer
 
         public void InitWithPDFViewer(PDFViewControl pdfViewControl)
@@ -265,7 +246,10 @@ namespace Compdfkit_Tools.Measure
 
         private void PDFToolManager_MouseLeftButtonUpHandler(object sender, MouseEventObject e)
         {
-            
+            if (e.IsCreate)
+            {
+                OnAnnotEditHandler?.Invoke(this, EventArgs.Empty);
+            }
         }
 
         private void PDFToolManager_MouseLeftButtonDownHandler(object sender, MouseEventObject e)