using ComPDFKit.PDFAnnotation; using ComPDFKit.PDFAnnotation.Form; using ComPDFKit.PDFDocument; using ComPDFKit.Tool; using ComPDFKit.Tool.Help; using System.Windows; using System.Windows.Controls; namespace Compdfkit_Tools.PDFControl { public partial class SignatureProperty : UserControl { private SignatureParam widgetParam = null; private CPDFSignatureWidget cPDFAnnotation = null; private PDFViewControl pdfViewerControl = null; private CPDFDocument cPDFDocument = null; bool IsLoadedData = false; public SignatureProperty() { InitializeComponent(); } public void SetProperty(AnnotParam annotParam, CPDFAnnotation annotation, CPDFDocument doc, PDFViewControl cPDFViewer) { widgetParam = (SignatureParam)annotParam; cPDFAnnotation = (CPDFSignatureWidget)annotation; pdfViewerControl = cPDFViewer; cPDFDocument = doc; } private void UserControl_Loaded(object sender, RoutedEventArgs e) { FormFieldCombox.SelectedIndex = (int)ParamConverter.ConverterWidgetFormFlags(widgetParam.Flags, widgetParam.IsHidden); IsLoadedData = true; } private void UserControl_Unloaded(object sender, RoutedEventArgs e) { IsLoadedData = false; } private void FormFieldCombox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (IsLoadedData) { cPDFAnnotation.SetFlags(ParamConverter.GetFormFlags((ParamConverter.FormField)(sender as ComboBox).SelectedIndex, cPDFAnnotation)); pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDateAnnotFrame(); } } } }