MeasurePropertyControl.xaml.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. using ComPDFKit.PDFAnnotation;
  2. using ComPDFKit.Tool;
  3. using Compdfkit_Tools.Measure.Property;
  4. using Compdfkit_Tools.PDFControl;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows;
  11. using System.Windows.Controls;
  12. using System.Windows.Data;
  13. using System.Windows.Documents;
  14. using System.Windows.Input;
  15. using System.Windows.Media;
  16. using System.Windows.Media.Imaging;
  17. using System.Windows.Navigation;
  18. using System.Windows.Shapes;
  19. namespace Compdfkit_Tools.Measure
  20. {
  21. /// <summary>
  22. /// MeasurePropertyControl.xaml 的交互逻辑
  23. /// </summary>
  24. public partial class MeasurePropertyControl : UserControl
  25. {
  26. private UIElement currentPanel = null;
  27. public MeasurePropertyControl()
  28. {
  29. InitializeComponent();
  30. }
  31. public void SetPropertyForMeasureCreate(AnnotParam Args)
  32. {
  33. if (Args == null)
  34. {
  35. ClearMeasurePanel();
  36. return;
  37. }
  38. switch (Args.CurrentType)
  39. {
  40. case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
  41. StraightnessProperty straightnessProperty = new StraightnessProperty();
  42. //if (attribEvent != null)
  43. //{
  44. // straightnessProperty.SetAnnotEventData(attribEvent);
  45. //}
  46. //else
  47. //{
  48. // straightnessProperty.SetAnnotArgsData((LineMeasureArgs)Args);
  49. //}
  50. currentPanel = straightnessProperty;
  51. break;
  52. case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
  53. //MultilineProperty multilineProperty = new MultilineProperty();
  54. //if (attribEvent != null)
  55. //{
  56. // multilineProperty.SetAnnotEventData(attribEvent);
  57. //}
  58. //else
  59. //{
  60. // multilineProperty.SetAnnotArgsData((PolyLineMeasureArgs)Args);
  61. //}
  62. //currentPanel = multilineProperty;
  63. break;
  64. case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
  65. //PolygonalProperty polygonalProperty = new PolygonalProperty();
  66. //if (attribEvent != null)
  67. //{
  68. // polygonalProperty.SetAnnotEventData(attribEvent);
  69. //}
  70. //else
  71. //{
  72. // polygonalProperty.SetAnnotArgsData((PolygonMeasureArgs)Args);
  73. //}
  74. //currentPanel = polygonalProperty;
  75. break;
  76. default:
  77. break;
  78. }
  79. SetMeasurePanel(currentPanel);
  80. }
  81. private void SetMeasurePanel(UIElement newChild)
  82. {
  83. MeasurePropertyPanel.Child = newChild;
  84. }
  85. public void ClearMeasurePanel()
  86. {
  87. currentPanel = null;
  88. MeasurePropertyPanel.Child = null;
  89. }
  90. //public void SetPorpertyForMeasureModify(AnnotAttribEvent annotEvent)
  91. //{
  92. //}
  93. }
  94. }