|
@@ -1,14 +1,16 @@
|
|
-using ComPDFKit.PDFAnnotation.Form;
|
|
|
|
-using Compdfkit_Tools.PDFControl;
|
|
|
|
|
|
+using Compdfkit_Tools.PDFControl;
|
|
using ComPDFKitViewer.AnnotEvent;
|
|
using ComPDFKitViewer.AnnotEvent;
|
|
using ComPDFKitViewer.PdfViewer;
|
|
using ComPDFKitViewer.PdfViewer;
|
|
using System;
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Windows;
|
|
using System.Windows;
|
|
-using System.Windows.Controls;
|
|
|
|
|
|
+using System.Windows.Controls;
|
|
|
|
+using System.Windows.Controls.Primitives;
|
|
using System.Windows.Input;
|
|
using System.Windows.Input;
|
|
-using System.Windows.Media;
|
|
|
|
|
|
+using System.Windows.Media;
|
|
|
|
+using Compdfkit_Tools.Helper;
|
|
|
|
+using ComPDFKit.PDFAnnotation.Form;
|
|
|
|
|
|
namespace Compdfkit_Tools.PDFControl
|
|
namespace Compdfkit_Tools.PDFControl
|
|
{
|
|
{
|
|
@@ -16,7 +18,9 @@ namespace Compdfkit_Tools.PDFControl
|
|
{
|
|
{
|
|
private bool isFirstLoad = true;
|
|
private bool isFirstLoad = true;
|
|
public PDFViewControl PDFViewControl = new PDFViewControl();
|
|
public PDFViewControl PDFViewControl = new PDFViewControl();
|
|
- public SignatureStatusBarControl SignatureStatusBarControl = new SignatureStatusBarControl();
|
|
|
|
|
|
+ private SignatureStatusBarControl signatureStatusBarControl;
|
|
|
|
+ private PanelState panelState = PanelState.GetInstance();
|
|
|
|
+ private CPDFDisplaySettingsControl displaySettingsControl = null;
|
|
private bool _isActive = false;
|
|
private bool _isActive = false;
|
|
public event EventHandler<bool> OnCanSaveChanged;
|
|
public event EventHandler<bool> OnCanSaveChanged;
|
|
private CPDFSignatureWidget currentSignatureWidget;
|
|
private CPDFSignatureWidget currentSignatureWidget;
|
|
@@ -86,6 +90,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
PDFGrid.Child = null;
|
|
PDFGrid.Child = null;
|
|
BotaContainer.Child = null;
|
|
BotaContainer.Child = null;
|
|
PropertyContainer.Child = null;
|
|
PropertyContainer.Child = null;
|
|
|
|
+ SignatureStatusBorder.Child = null;
|
|
}
|
|
}
|
|
|
|
|
|
public void InitWithPDFViewer(CPDFViewer pdfViewer)
|
|
public void InitWithPDFViewer(CPDFViewer pdfViewer)
|
|
@@ -99,6 +104,10 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
|
|
|
PDFViewControl.PDFView.WidgetClickHandler -= PDFView_WidgetClickHandler;
|
|
PDFViewControl.PDFView.WidgetClickHandler -= PDFView_WidgetClickHandler;
|
|
PDFViewControl.PDFView.WidgetClickHandler += PDFView_WidgetClickHandler;
|
|
PDFViewControl.PDFView.WidgetClickHandler += PDFView_WidgetClickHandler;
|
|
|
|
+
|
|
|
|
+ panelState.PropertyChanged -= PanelState_PropertyChanged;
|
|
|
|
+ panelState.PropertyChanged += PanelState_PropertyChanged;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
private void PDFView_WidgetClickHandler(object sender, WidgetArgs e)
|
|
private void PDFView_WidgetClickHandler(object sender, WidgetArgs e)
|
|
@@ -138,7 +147,8 @@ namespace Compdfkit_Tools.PDFControl
|
|
}
|
|
}
|
|
else if (e == Common.CPDFDigitalSignatureBarControl.DigitalSignatureAction.VerifySignature)
|
|
else if (e == Common.CPDFDigitalSignatureBarControl.DigitalSignatureAction.VerifySignature)
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ ToggleButton button = sender as ToggleButton;
|
|
|
|
+ button.IsChecked = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -169,10 +179,75 @@ namespace Compdfkit_Tools.PDFControl
|
|
PDFViewControl.PDFView.UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
|
|
PDFViewControl.PDFView.UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
|
|
PDFViewControl.PDFView.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
|
|
PDFViewControl.PDFView.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
|
|
PDFViewControl.PDFView.SetFormFieldHighlight(true);
|
|
PDFViewControl.PDFView.SetFormFieldHighlight(true);
|
|
- SignatureBorder.Child = SignatureStatusBarControl;
|
|
|
|
- SignatureStatusBarControl.Status = SignatureStatus.Invalid;
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void PanelState_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ if (e.PropertyName == nameof(PanelState.IsLeftPanelExpand))
|
|
|
|
+ {
|
|
|
|
+ ExpandLeftPanel(panelState.IsLeftPanelExpand);
|
|
|
|
+ }
|
|
|
|
+ else if (e.PropertyName == nameof(PanelState.RightPanel))
|
|
|
|
+ {
|
|
|
|
+ if (panelState.RightPanel == PanelState.RightPanelState.ViewSettings)
|
|
|
|
+ {
|
|
|
|
+ ExpandRightPropertyPanel((IsActive)?displaySettingsControl:null, Visibility.Visible);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ ExpandRightPropertyPanel(null, Visibility.Collapsed);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void ExpandLeftPanel(bool isExpand)
|
|
|
|
+ {
|
|
|
|
+ BotaContainer.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
|
|
|
|
+ Splitter.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
|
|
|
|
+ if (isExpand)
|
|
|
|
+ {
|
|
|
|
+ BodyGrid.ColumnDefinitions[0].Width = new GridLength(320);
|
|
|
|
+ BodyGrid.ColumnDefinitions[1].Width = new GridLength(15);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ BodyGrid.ColumnDefinitions[0].Width = new GridLength(0);
|
|
|
|
+ BodyGrid.ColumnDefinitions[1].Width = new GridLength(0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void ExpandRightPropertyPanel(UIElement propertytPanel, Visibility visible)
|
|
|
|
+ {
|
|
|
|
+ PropertyContainer.Width = 260;
|
|
|
|
+ PropertyContainer.Child = propertytPanel;
|
|
|
|
+ PropertyContainer.Visibility = visible;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void SetBOTAContainer(CPDFBOTABarControl botaControl)
|
|
|
|
+ {
|
|
|
|
+ this.BotaContainer.Child = botaControl;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void SetDisplaySettingsControl(CPDFDisplaySettingsControl displaySettingsControl)
|
|
|
|
+ {
|
|
|
|
+ this.displaySettingsControl = displaySettingsControl;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void SetSignatureStatusBarControl(SignatureStatusBarControl signatureStatusBarControl)
|
|
|
|
+ {
|
|
|
|
+ this.signatureStatusBarControl = signatureStatusBarControl;
|
|
|
|
+ SignatureStatusBorder.Child = this.signatureStatusBarControl;
|
|
|
|
+ if (signatureStatusBarControl.Status != SignatureStatus.None)
|
|
|
|
+ {
|
|
|
|
+ SignatureStatusBorder.Visibility = Visibility.Visible;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ SignatureStatusBorder.Visibility = Visibility.Collapsed;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Undo Redo Event Noitfy
|
|
/// Undo Redo Event Noitfy
|
|
/// </summary>
|
|
/// </summary>
|