|
@@ -25,7 +25,17 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
private bool isFirstLoad = true;
|
|
|
public PDFViewControl PdfViewControl = new PDFViewControl();
|
|
|
public CPDFAnnotationControl PDFAnnotationControl = null;
|
|
|
- public bool IsActive = false;
|
|
|
+ private bool _isActive = false;
|
|
|
+ public bool IsActive
|
|
|
+ {
|
|
|
+ get => _isActive;
|
|
|
+
|
|
|
+ set
|
|
|
+ {
|
|
|
+ _isActive = value;
|
|
|
+ OnPropertyChanged();
|
|
|
+ }
|
|
|
+ }
|
|
|
private CPDFDisplaySettingsControl displaySettingsControl = null;
|
|
|
|
|
|
private PanelState panelState = PanelState.GetInstance();
|
|
@@ -111,12 +121,11 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
}
|
|
|
else if (panelState.RightPanel == PanelState.RightPanelState.ViewSettings)
|
|
|
{
|
|
|
- ExpandRightPropertyPanel((IsActive)?displaySettingsControl:null, Visibility.Visible);
|
|
|
+ ExpandRightPropertyPanel((IsActive) ? displaySettingsControl : null, Visibility.Visible);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
ExpandRightPropertyPanel(null, Visibility.Collapsed);
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -152,11 +161,18 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
|
|
|
#region Load Unload custom control
|
|
|
|
|
|
- private void MainWindow_Loaded(object sender, RoutedEventArgs e)
|
|
|
+ private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
InitialPDFViewControl(PdfViewControl);
|
|
|
+ PdfViewControl.PDFView.AnnotCommandHandler += PDFView_AnnotCommandHandler;
|
|
|
}
|
|
|
|
|
|
+ private void UserControl_Unloaded(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ PdfViewControl.PDFView.AnnotCommandHandler -= PDFView_AnnotCommandHandler;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private void AnnotationBarControl_Loaded(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
AnnotationBarControl.AnnotationPropertyChanged += AnnotationBarControl_AnnotationPropertyChanged;
|
|
@@ -182,8 +198,6 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
ExpandRightPropertyPanel(null, Visibility.Collapsed);
|
|
|
PDFAnnotationControl.ClearAnnotationBar -= PdfAnnotationControl_ClearAnnotationBar;
|
|
|
PDFAnnotationControl.ClearAnnotationBar += PdfAnnotationControl_ClearAnnotationBar;
|
|
|
- PdfViewControl.PDFView.AnnotCommandHandler -= PDFView_AnnotCommandHandler;
|
|
|
- PdfViewControl.PDFView.AnnotCommandHandler += PDFView_AnnotCommandHandler;
|
|
|
PdfViewControl.PDFView.AnnotEditHandler -= PDFView_AnnotEditHandler;
|
|
|
PdfViewControl.PDFView.AnnotEditHandler += PDFView_AnnotEditHandler;
|
|
|
PdfViewControl.PDFView.UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
|
|
@@ -692,7 +706,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
PDFGrid.Child = null;
|
|
|
BotaContainer.Child = null;
|
|
|
- PropertyContainer.Child= null;
|
|
|
+ PropertyContainer.Child = null;
|
|
|
}
|
|
|
}
|
|
|
}
|