Explorar o código

compdfkit(win) - 移除 IsActive 属性

weixiangjie hai 1 ano
pai
achega
d9ef64fb31

+ 0 - 4
Demo/Examples/Annotations/MainWindow.xaml.cs

@@ -303,17 +303,14 @@ namespace AnnotationViewControl
             if (currentMode == "Viewer")
             {
                 regularViewerControl.ClearViewerControl();
-                regularViewerControl.IsActive = false;
             }
             else if (currentMode == "Annotation")
             {
                 annotationControl.ClearViewerControl();
-                annotationControl.IsActive = false;
             }
 
             if (item.Content as string == "Viewer")
             {
-                regularViewerControl.IsActive = true;
                 if (regularViewerControl.PdfViewControl != null && regularViewerControl.PdfViewControl.PDFView != null)
                 {
                     PDFGrid.Child = regularViewerControl;
@@ -326,7 +323,6 @@ namespace AnnotationViewControl
             }
             else if (item.Content as string == "Annotation")
             {
-                annotationControl.IsActive = true;
                 if (annotationControl.PDFViewControl != null && annotationControl.PDFViewControl.PDFView != null)
                 {
                     PDFGrid.Child = annotationControl;

+ 2 - 12
Demo/Examples/Compdfkit_Tools/Annotation/AnnotationControl/AnnotationControl.xaml.cs

@@ -25,17 +25,6 @@ namespace Compdfkit_Tools.PDFControl
         private bool isFirstLoad = true;
         public PDFViewControl PDFViewControl = new PDFViewControl();
         public CPDFAnnotationControl PDFAnnotationControl = null;
-        private bool _isActive = false;
-        public bool IsActive
-        {
-            get => _isActive;
-
-            set
-            {
-                _isActive = value;
-                OnPropertyChanged();
-            }
-        }
         private CPDFDisplaySettingsControl displaySettingsControl = null;
 
         private PanelState panelState = PanelState.GetInstance();
@@ -122,7 +111,7 @@ namespace Compdfkit_Tools.PDFControl
                 }
                 else if (panelState.RightPanel == PanelState.RightPanelState.ViewSettings)
                 {
-                    ExpandRightPropertyPanel((IsActive) ? displaySettingsControl : null, Visibility.Visible);
+                    ExpandRightPropertyPanel(displaySettingsControl, Visibility.Visible);
                 }
                 else
                 {
@@ -746,6 +735,7 @@ namespace Compdfkit_Tools.PDFControl
             PDFGrid.Child = null;
             BotaContainer.Child = null;
             PropertyContainer.Child = null;
+            displaySettingsControl = null;
         }
     }
 }

+ 2 - 13
Demo/Examples/Compdfkit_Tools/DigitalSignature/DigitalSignatureControl/DigitalSignatureControl.xaml.cs

@@ -27,7 +27,6 @@ namespace Compdfkit_Tools.PDFControl
         private PanelState panelState = PanelState.GetInstance();
         private CPDFDisplaySettingsControl displaySettingsControl = null;
         private double[] zoomLevelList = { 1f, 8f, 12f, 25, 33f, 50, 66f, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
-        private bool _isActive = false;
         public event EventHandler<bool> OnCanSaveChanged;
         private CPDFSignatureWidget currentSignatureWidget;
         public event EventHandler<string> AfterFillSignature;
@@ -39,17 +38,6 @@ namespace Compdfkit_Tools.PDFControl
             PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
         }
 
-        public bool IsActive
-        {
-            get => _isActive;
-
-            set
-            {
-                _isActive = value;
-                OnPropertyChanged();
-            }
-        }
-
         public bool CanUndo
         {
             get
@@ -104,6 +92,7 @@ namespace Compdfkit_Tools.PDFControl
             PDFGrid.Child = null;
             BotaContainer.Child = null;
             PropertyContainer.Child = null;
+            displaySettingsControl = null;
             SignatureStatusBorder.Child = null;
         }
 
@@ -224,7 +213,7 @@ namespace Compdfkit_Tools.PDFControl
             {
                 if (panelState.RightPanel == PanelState.RightPanelState.ViewSettings)
                 {
-                    ExpandRightPropertyPanel((IsActive) ? displaySettingsControl : null, Visibility.Visible);
+                    ExpandRightPropertyPanel(displaySettingsControl, Visibility.Visible);
                 }
                 else
                 {

+ 2 - 12
Demo/Examples/Compdfkit_Tools/Edit/ContentEditCOntrol/ContentEditControl.xaml.cs

@@ -34,17 +34,6 @@ namespace Compdfkit_Tools.PDFControl
         public PDFViewControl PdfViewControl = new PDFViewControl();
         public PDFContentEditControl pdfContentEditControl = new PDFContentEditControl();
         private CPDFDisplaySettingsControl displaySettingsControl = null;
-        private bool _isActive = false;
-        public bool IsActive
-        {
-            get => _isActive;
-
-            set
-            {
-                _isActive = value;
-                OnPropertyChanged(); 
-            }
-        }
 
         private double[] zoomLevelList = { 1f, 8f, 12f, 25, 33f, 50, 66f, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
 
@@ -120,7 +109,7 @@ namespace Compdfkit_Tools.PDFControl
                 }
                 else if (panelState.RightPanel == PanelState.RightPanelState.ViewSettings)
                 {
-                    ExpandRightPropertyPanel((IsActive)?displaySettingsControl:null, Visibility.Visible);
+                    ExpandRightPropertyPanel(displaySettingsControl, Visibility.Visible);
                 }
                 else
                 {
@@ -370,6 +359,7 @@ namespace Compdfkit_Tools.PDFControl
             PDFGrid.Child = null;
             BotaContainer.Child = null;
             PropertyContainer.Child = null;
+            displaySettingsControl = null;
         }
         
         #region Property changed

+ 2 - 12
Demo/Examples/Compdfkit_Tools/Form/FormControl/FormControl.xaml.cs

@@ -30,17 +30,6 @@ namespace Compdfkit_Tools.PDFControl
 
         public PDFViewControl PdfViewControl = new PDFViewControl();
         public FromPropertyControl FromPropertyControl = new FromPropertyControl();
-        private bool _isActive = false;
-        public bool IsActive
-        {
-            get => _isActive;
-
-            set
-            {
-                _isActive = value;
-                OnPropertyChanged();
-            }
-        }
         private double[] zoomLevelList = { 1f, 8f, 12f, 25, 33f, 50, 66f, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
         public event PropertyChangedEventHandler PropertyChanged;
         private CPDFDisplaySettingsControl displaySettingsControl;
@@ -108,7 +97,7 @@ namespace Compdfkit_Tools.PDFControl
                 }
                 else if (panelState.RightPanel == PanelState.RightPanelState.ViewSettings)
                 {
-                    ExpandRightPropertyPanel((IsActive)?displaySettingsControl:null, Visibility.Visible);
+                    ExpandRightPropertyPanel(displaySettingsControl, Visibility.Visible);
                 }
                 else
                 {
@@ -331,6 +320,7 @@ namespace Compdfkit_Tools.PDFControl
             PDFGrid.Child = null;
             BotaContainer.Child = null;
             PropertyContainer.Child = null;
+            displaySettingsControl = null;
         }
         
         #region Property changed

+ 2 - 13
Demo/Examples/Compdfkit_Tools/PDFView/RegularViewerControl.xaml.cs

@@ -29,18 +29,6 @@ namespace Compdfkit_Tools.PDFView
         public event PropertyChangedEventHandler PropertyChanged;
         public event EventHandler<bool> OnCanSaveChanged;
 
-        private bool _isActive = false;
-        public bool IsActive
-        {
-            get => _isActive;
-
-            set
-            {
-                _isActive = value;
-                OnPropertyChanged();
-            }
-        }
-
         private bool CanSave
         {
             get
@@ -74,7 +62,7 @@ namespace Compdfkit_Tools.PDFView
                 }
                 else if (panelState.RightPanel == PanelState.RightPanelState.ViewSettings)
                 {
-                    ExpandRightPropertyPanel((IsActive)?displaySettingsControl:null, Visibility.Visible);
+                    ExpandRightPropertyPanel(displaySettingsControl, Visibility.Visible);
                 }
                 else
                 {
@@ -166,6 +154,7 @@ namespace Compdfkit_Tools.PDFView
             BotaContainer.Child = null;
             PropertyContainer.Child= null;
             SignatureStatusBorder.Child = null;
+            displaySettingsControl = null;
         }
         
         #region PropertyChanged

+ 0 - 4
Demo/Examples/ContentEditor/MainWindow.xaml.cs

@@ -262,8 +262,6 @@ namespace ContentEditorViewControl
             var item = (sender as ComboBox).SelectedItem as ComboBoxItem;
             if ((string)item.Content == "Viewer")
             {
-                regularViewerControl.IsActive = true;
-                contentEditControl.IsActive = false;
                 if (regularViewerControl.PdfViewControl != null && regularViewerControl.PdfViewControl.PDFView != null)
                 {
                     contentEditControl.ClearViewerControl();
@@ -279,8 +277,6 @@ namespace ContentEditorViewControl
             }
             else if ((string)item.Content == "Content Edit")
             {
-                contentEditControl.IsActive = true;
-                regularViewerControl.IsActive = false;
                 if (contentEditControl.PdfViewControl != null && contentEditControl.PdfViewControl.PDFView != null)
                 {
                     regularViewerControl.ClearViewerControl();

+ 0 - 5
Demo/Examples/DigitalSignature/MainWindow.xaml.cs

@@ -225,7 +225,6 @@ namespace DigitalSignature
             pdfViewer.PDFView.ChangeFitMode(FitMode.FitWidth);
             CPDFSaclingControl.InitWithPDFViewer(pdfViewer.PDFView);
             
-            regularViewerControl.IsActive = true;
             digitalSignatureControl.InitWithPDFViewer(pdfViewer.PDFView);
         }
 
@@ -321,17 +320,14 @@ namespace DigitalSignature
             if (currentMode == "Viewer")
             {
                 regularViewerControl.ClearViewerControl();
-                regularViewerControl.IsActive = false;
             }
             else if (currentMode == "Digital Signature")
             {
                 digitalSignatureControl.ClearViewerControl();
-                digitalSignatureControl.IsActive = false;
             }
 
             if (item.Content as string == "Viewer")
             {
-                regularViewerControl.IsActive = true;
                 if (regularViewerControl.PdfViewControl != null && regularViewerControl.PdfViewControl.PDFView != null)
                 {
                     PDFGrid.Child = regularViewerControl;
@@ -345,7 +341,6 @@ namespace DigitalSignature
             }
             else if (item.Content as string == "Digital Signature")
             {
-                digitalSignatureControl.IsActive = true;
                 if (digitalSignatureControl.PDFViewControl != null && digitalSignatureControl.PDFViewControl.PDFView != null)
                 {
                     PDFGrid.Child = digitalSignatureControl;

+ 0 - 9
Demo/Examples/PDFViewer/MainPage.xaml.cs

@@ -134,7 +134,6 @@ namespace PDFViewer
             pdfViewer.PDFView.ChangeFitMode(FitMode.FitWidth);
             CPDFSaclingControl.InitWithPDFViewer(pdfViewer.PDFView);
             ModeComboBox.SelectedIndex = 0;
-            regularViewerControl.IsActive = true;
 
             CPDFSaclingControl.SetZoomTextBoxText(string.Format("{0}", (int)(pdfViewer.PDFView.ZoomFactor * 100)));
 
@@ -316,25 +315,21 @@ namespace PDFViewer
             if (currentMode == "Viewer")
             {
                 regularViewerControl.ClearViewerControl();
-                regularViewerControl.IsActive = false;
             }
             else if (currentMode == "Annotation")
             {
                 annotationControl.UnloadEvent();
                 annotationControl.ClearViewerControl();
-                annotationControl.IsActive = false;
             }
             else if (currentMode == "Form")
             {
                 formControl.ClearViewerControl();
                 formControl.UnloadEvent();
                 formControl.ClearViewerControl();
-                formControl.IsActive = false;
             }
             else if (currentMode == "Content Editor")
             {
                 contentEditControl.ClearViewerControl();
-                contentEditControl.IsActive = false;
             }
             else if (currentMode == "Docs Editor")
             {
@@ -344,7 +339,6 @@ namespace PDFViewer
 
             if (item.Content as string == "Viewer")
             {
-                regularViewerControl.IsActive = true;
                 if (regularViewerControl.PdfViewControl != null && regularViewerControl.PdfViewControl.PDFView != null)
                 {
                     PDFGrid.Child = regularViewerControl;
@@ -359,7 +353,6 @@ namespace PDFViewer
             }
             else if (item.Content as string == "Annotation")
             {
-                annotationControl.IsActive = true;
                 annotationControl.SetToolBarContainerVisibility(Visibility.Visible);
                 if (annotationControl.PDFViewControl != null && annotationControl.PDFViewControl.PDFView != null)
                 {
@@ -379,7 +372,6 @@ namespace PDFViewer
             }
             else if (item.Content as string == "Form")
             {
-                formControl.IsActive = true;
                 formControl.SetToolBarContainerVisibility(Visibility.Visible);
                 if (formControl.PdfViewControl != null && formControl.PdfViewControl.PDFView != null)
                 {
@@ -398,7 +390,6 @@ namespace PDFViewer
             }
             else if (item.Content as string == "Content Editor")
             {
-                contentEditControl.IsActive = true;
                 if (contentEditControl.pdfContentEditControl != null && contentEditControl.PdfViewControl.PDFView != null)
                 {
                     pdfViewer.PDFView?.SetPDFEditType(CPDFEditType.EditText | CPDFEditType.EditImage);