Browse Source

ComPDFKit.Demo(win) - 修复注释和表单模块undo/redo按钮刷新问题

TangJinZhou 3 months ago
parent
commit
72d4a71d78

+ 3 - 0
Demo/Examples/Compdfkit.Controls/Annotation/AnnotationControl/AnnotationControl.xaml.cs

@@ -236,6 +236,9 @@ baseWidget.GetAnnotData().Annot);
             PDFViewControl.MouseLeftButtonUpHandler += PDFToolManager_MouseLeftButtonUpHandler;
             PDFViewControl.PDFViewTool.AnnotChanged -= PDFViewTool_AnnotChanged;
             PDFViewControl.PDFViewTool.AnnotChanged += PDFViewTool_AnnotChanged;
+
+            OnPropertyChanged("CanRedo");
+            OnPropertyChanged("CanUndo");
         }
 
         private void PDFToolManager_CreatePolygonFinished(object sender, EventArgs e)

+ 3 - 0
Demo/Examples/Compdfkit.Controls/Form/FormControl/FormControl.xaml.cs

@@ -294,6 +294,9 @@ namespace ComPDFKit.Controls.PDFControl
 
             panelState.PropertyChanged -= PanelState_PropertyChanged;
             panelState.PropertyChanged += PanelState_PropertyChanged;
+
+            OnPropertyChanged("CanRedo");
+            OnPropertyChanged("CanUndo");
         }
 
         public void SetBOTAContainer(CPDFBOTABarControl botaControl)

+ 2 - 3
Demo/Examples/PDFViewer/MainPage.xaml.cs

@@ -574,13 +574,12 @@ namespace PDFViewer
             else if (item.Tag as string == "Annotation")
             {
                 annotationControl.SetToolBarContainerVisibility(Visibility.Visible);
-                PDFGrid.Child = annotationControl;
-
-                viewControl.SetToolType(ToolType.Pan);
                 annotationControl.PDFViewControl = viewControl;
                 annotationControl.InitWithPDFViewer(viewControl);
                 if (annotationControl.PDFViewControl != null)
                 {
+                    PDFGrid.Child = annotationControl;
+                    viewControl.SetToolType(ToolType.Pan);
                     annotationControl.OnCanSaveChanged -= ControlOnCanSaveChanged;
                     annotationControl.OnCanSaveChanged += ControlOnCanSaveChanged;