FromPropertyControl.xaml.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using compdfkit_tools.Form.Property;
  2. using ComPDFKitViewer.AnnotEvent;
  3. using ComPDFKitViewer.PdfViewer;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Imaging;
  16. using System.Windows.Navigation;
  17. using System.Windows.Shapes;
  18. namespace compdfkit_tools.Form
  19. {
  20. /// <summary>
  21. /// FromPropertyControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class FromPropertyControl : UserControl
  24. {
  25. private CPDFViewer pdfViewer;
  26. private UIElement currentPanel = null;
  27. public FromPropertyControl()
  28. {
  29. InitializeComponent();
  30. }
  31. public void CleanProperty()
  32. {
  33. }
  34. public void SetPropertyForType(WidgetArgs Args, AnnotAttribEvent e)
  35. {
  36. currentPanel = null;
  37. switch (Args.WidgeType)
  38. {
  39. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_PUSHBUTTON:
  40. break;
  41. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_CHECKBOX:
  42. break;
  43. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_RADIOBUTTON:
  44. break;
  45. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_TEXTFIELD:
  46. TextFieldProperty textFieldProperty = new TextFieldProperty();
  47. textFieldProperty.SetProperty(Args,e);
  48. currentPanel = textFieldProperty;
  49. break;
  50. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_COMBOBOX:
  51. break;
  52. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_LISTBOX:
  53. break;
  54. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_SIGNATUREFIELDS:
  55. break;
  56. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_UNKNOWN:
  57. break;
  58. default:
  59. break;
  60. }
  61. SetAnnotationPanel(currentPanel);
  62. }
  63. private void SetAnnotationPanel(UIElement newChild)
  64. {
  65. FromPropertyPanel.Child = newChild;
  66. }
  67. public void SetPDFViewer(CPDFViewer pdfViewer)
  68. {
  69. this.pdfViewer = pdfViewer;
  70. }
  71. private void UserControl_Loaded(object sender, RoutedEventArgs e)
  72. {
  73. }
  74. private void UserControl_Unloaded(object sender, RoutedEventArgs e)
  75. {
  76. }
  77. }
  78. }