MeasurePropertyControl.xaml.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. //MultilineProperty pushButtonProperty2 = new MultilineProperty();
  30. //MeasurePropertyPanel.Child = pushButtonProperty2;
  31. }
  32. public void SetPropertyForType(AnnotHandlerEventArgs Args, AnnotAttribEvent e)
  33. {
  34. currentPanel = null;
  35. if (Args == null)
  36. {
  37. SetMeasurePanel(currentPanel);
  38. return;
  39. }
  40. switch (Args.EventType)
  41. {
  42. case AnnotArgsType.LineMeasure:
  43. MultilineProperty multilineProperty = new MultilineProperty();
  44. currentPanel = multilineProperty;
  45. break;
  46. case AnnotArgsType.PolyLineMeasure:
  47. PolygonalProperty polygonalProperty = new PolygonalProperty();
  48. currentPanel = polygonalProperty;
  49. break;
  50. case AnnotArgsType.PolygonMeasure:
  51. RectanglesProperty rectanglesProperty = new RectanglesProperty();
  52. currentPanel = rectanglesProperty;
  53. break;
  54. default:
  55. break;
  56. }
  57. SetMeasurePanel(currentPanel);
  58. }
  59. private void SetMeasurePanel(UIElement newChild)
  60. {
  61. MeasurePropertyPanel.Child = newChild;
  62. }
  63. }
  64. }