SignatureProperty.xaml.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using ComPDFKitViewer;
  2. using ComPDFKitViewer.AnnotEvent;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace Compdfkit_Tools.PDFControl
  18. {
  19. /// <summary>
  20. /// SignatureProperty.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class SignatureProperty : UserControl
  23. {
  24. private WidgetSignArgs widgetArgs = null;
  25. private AnnotAttribEvent annotAttribEvent = null;
  26. bool IsLoadedData = false;
  27. public SignatureProperty()
  28. {
  29. InitializeComponent();
  30. }
  31. public void SetProperty(WidgetArgs Args, AnnotAttribEvent e)
  32. {
  33. widgetArgs = (WidgetSignArgs)Args;
  34. annotAttribEvent = e;
  35. }
  36. private void UserControl_Loaded(object sender, RoutedEventArgs e)
  37. {
  38. FormFieldCombox.SelectedIndex = (int)widgetArgs.FormField;
  39. IsLoadedData = true;
  40. }
  41. private void UserControl_Unloaded(object sender, RoutedEventArgs e)
  42. {
  43. IsLoadedData = false;
  44. }
  45. private void FormFieldCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  46. {
  47. if (IsLoadedData)
  48. {
  49. annotAttribEvent.UpdateAttrib(AnnotAttrib.FormField, (sender as ComboBox).SelectedIndex);
  50. annotAttribEvent.UpdateAnnot();
  51. }
  52. }
  53. }
  54. }