SignatureProperty.xaml.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using ComPDFKitViewer;
  2. using ComPDFKitViewer.AnnotEvent;
  3. using System.Windows;
  4. using System.Windows.Controls;
  5. namespace Compdfkit_Tools.PDFControl
  6. {
  7. public partial class SignatureProperty : UserControl
  8. {
  9. private WidgetSignArgs widgetArgs = null;
  10. private AnnotAttribEvent annotAttribEvent = null;
  11. bool IsLoadedData = false;
  12. public SignatureProperty()
  13. {
  14. InitializeComponent();
  15. }
  16. public void SetProperty(WidgetArgs Args, AnnotAttribEvent e)
  17. {
  18. widgetArgs = (WidgetSignArgs)Args;
  19. annotAttribEvent = e;
  20. }
  21. private void UserControl_Loaded(object sender, RoutedEventArgs e)
  22. {
  23. FormFieldCmb.SelectedIndex = (int)widgetArgs.FormField;
  24. IsLoadedData = true;
  25. }
  26. private void UserControl_Unloaded(object sender, RoutedEventArgs e)
  27. {
  28. IsLoadedData = false;
  29. }
  30. private void FormFieldCmb_SelectionChanged(object sender, SelectionChangedEventArgs e)
  31. {
  32. if (IsLoadedData)
  33. {
  34. annotAttribEvent.UpdateAttrib(AnnotAttrib.FormField, (sender as ComboBox).SelectedIndex);
  35. annotAttribEvent.UpdateAnnot();
  36. }
  37. }
  38. }
  39. }