CPDFArrowControl.xaml.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.Common
  19. {
  20. /// <summary>
  21. /// CPDFArrowControlControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class CPDFArrowControl : UserControl
  24. {
  25. public event EventHandler ArrowChanged;
  26. private LineType _lineType;
  27. public LineType LineType
  28. {
  29. get
  30. {
  31. return new LineType()
  32. {
  33. HeadLineType = CPDFAnnotationDictionary.GetLineTypeFromIndex[CPDFHeadArrowUI.SelectedIndex],
  34. TailLineType = CPDFAnnotationDictionary.GetLineTypeFromIndex[CPDFTailArrowUI.SelectedIndex]
  35. };
  36. }
  37. set
  38. {
  39. _lineType = value;
  40. CPDFHeadArrowUI.SelectedIndex = (int)_lineType.HeadLineType;
  41. CPDFTailArrowUI.SelectedIndex = (int)_lineType.TailLineType;
  42. }
  43. }
  44. public CPDFArrowControl()
  45. {
  46. InitializeComponent();
  47. CPDFHeadArrowUI.ArrowChanged += CPDFHeadArrowUI_ArrowChanged;
  48. CPDFTailArrowUI.ArrowChanged += CPDFTailArrowUI_ArrowChanged;
  49. Loaded += CPDFArrowControl_Loaded;
  50. }
  51. private void CPDFArrowControl_Loaded(object sender, RoutedEventArgs e)
  52. {
  53. CPDFTailArrowUI.RotateContent(180);
  54. }
  55. private void CPDFTailArrowUI_ArrowChanged(object sender, EventArgs e)
  56. {
  57. ArrowChanged?.Invoke(this, EventArgs.Empty);
  58. }
  59. private void CPDFHeadArrowUI_ArrowChanged(object sender, EventArgs e)
  60. {
  61. ArrowChanged?.Invoke((object)this, EventArgs.Empty);
  62. }
  63. }
  64. }