Przeglądaj źródła

ComPDFKit(win) - 页面编辑保存补充

weixiangjie 7 miesięcy temu
rodzic
commit
f6221f0dc7

+ 6 - 3
Demo/Examples/Compdfkit_Tools/PageEdit/PDFPageEdit/CPDFPageEditControl.xaml.cs

@@ -185,6 +185,7 @@ namespace Compdfkit_Tools.PDFControl
             if (result != null)
             {
                 DoInsert(result);
+                CanSave = true;
             }
             else
             {
@@ -1507,6 +1508,7 @@ namespace Compdfkit_Tools.PDFControl
             ItemsInViewHitTest();
             this.PageMoved?.Invoke(this, new RoutedEventArgs());
             UpdateSortedPageNum(sourceindex, targetindex);
+            CanSave = true;
         }
          
         private void UpdateSortedPageNum(int sourceIndex, int targetIndex)
@@ -1610,8 +1612,8 @@ namespace Compdfkit_Tools.PDFControl
                     if (visiblePageIndexes.Contains(insertindex + i))
                         visiblePageIndexes.Remove(insertindex + i); 
                 }
-                 CPDFViewer pdfViewer=GetPDFViewer();
-                if(pdfViewer!=null)
+                CPDFViewer pdfViewer=GetPDFViewer();
+                if(pdfViewer != null)
                 {
                     pdfViewer.UndoManager?.ClearHistory();
                 }
@@ -1667,6 +1669,7 @@ namespace Compdfkit_Tools.PDFControl
             }
             pdfViewer?.UpdateVirtualNodes();
             ItemsInViewHitTest();
+            CanSave = true;
         }
          
         public static string CreateFilePath(string path)
@@ -1861,7 +1864,7 @@ namespace Compdfkit_Tools.PDFControl
                 pageList.Add(PageEditListBox.Items[insertIndex + i] as ListBoxItem);
                 PageEditListBox.SelectedItems.Add(PageEditListBox.Items[insertIndex + i] as ListBoxItem);
             }
-
+            CanSave = true;
             UpdateAllPageNum();
         }