MeasurePropertyControl.xaml.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using Compdfkit_Tools.Measure.Property;
  2. using Compdfkit_Tools.PDFControl;
  3. using ComPDFKitViewer.AnnotEvent;
  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.Measure
  19. {
  20. /// <summary>
  21. /// MeasurePropertyControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class MeasurePropertyControl : UserControl
  24. {
  25. private UIElement currentPanel = null;
  26. public MeasurePropertyControl()
  27. {
  28. InitializeComponent();
  29. }
  30. public void SetPropertyForMeasureCreate(AnnotHandlerEventArgs Args)
  31. {
  32. if (Args == null)
  33. {
  34. ClearMeasurePanel();
  35. return;
  36. }
  37. switch (Args.EventType)
  38. {
  39. case AnnotArgsType.LineMeasure:
  40. StraightnessProperty straightnessProperty = new StraightnessProperty();
  41. straightnessProperty.SetAnnotArgsData((LineMeasureArgs)Args);
  42. currentPanel = straightnessProperty;
  43. break;
  44. case AnnotArgsType.PolyLineMeasure:
  45. MultilineProperty multilineProperty = new MultilineProperty();
  46. multilineProperty.SetAnnotArgsData((PolyLineMeasureArgs)Args);
  47. currentPanel = multilineProperty;
  48. break;
  49. case AnnotArgsType.PolygonMeasure:
  50. PolygonalProperty polygonalProperty = new PolygonalProperty();
  51. polygonalProperty.SetAnnotArgsData((PolygonMeasureArgs)Args);
  52. currentPanel = polygonalProperty;
  53. break;
  54. default:
  55. break;
  56. }
  57. SetMeasurePanel(currentPanel);
  58. }
  59. private void SetMeasurePanel(UIElement newChild)
  60. {
  61. MeasurePropertyPanel.Child = newChild;
  62. }
  63. public void ClearMeasurePanel()
  64. {
  65. currentPanel = null;
  66. MeasurePropertyPanel.Child = null;
  67. }
  68. public void SetPorpertyForMeasureModify(AnnotAttribEvent annotEvent)
  69. {
  70. }
  71. }
  72. }