CPDFArrowControl.xaml.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using ComPDFKit.PDFAnnotation;
  2. using compdfkit_tools.Data;
  3. using compdfkit_tools.PDFControlUI;
  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.PDFControl
  19. {
  20. /// <summary>
  21. /// CPDFArrowControlControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class CPDFArrowControl : UserControl
  24. {
  25. public event EventHandler ArrowChanged;
  26. public LineType LineType
  27. {
  28. get
  29. {
  30. return new LineType()
  31. {
  32. HeadType = CPDFAnnotationDictionary.GetLineTypeFromIndex[CPDFHeadArrowUI.SelectedIndex],
  33. TailType = CPDFAnnotationDictionary.GetLineTypeFromIndex[CPDFTailArrowUI.SelectedIndex]
  34. };
  35. }
  36. }
  37. public CPDFArrowControl()
  38. {
  39. InitializeComponent();
  40. CPDFHeadArrowUI.ArrowChanged += CPDFHeadArrowUI_ArrowChanged;
  41. CPDFTailArrowUI.ArrowChanged += CPDFTailArrowUI_ArrowChanged;
  42. }
  43. private void CPDFTailArrowUI_ArrowChanged(object sender, EventArgs e)
  44. {
  45. ArrowChanged?.Invoke(this, EventArgs.Empty);
  46. }
  47. private void CPDFHeadArrowUI_ArrowChanged(object sender, EventArgs e)
  48. {
  49. ArrowChanged?.Invoke((object)this, EventArgs.Empty);
  50. }
  51. }
  52. }