using Compdfkit_Tools.Measure.Property; using Compdfkit_Tools.PDFControl; using ComPDFKitViewer.AnnotEvent; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Compdfkit_Tools.Measure { /// /// MeasurePropertyControl.xaml 的交互逻辑 /// public partial class MeasurePropertyControl : UserControl { private UIElement currentPanel = null; public MeasurePropertyControl() { InitializeComponent(); //MultilineProperty pushButtonProperty2 = new MultilineProperty(); //MeasurePropertyPanel.Child = pushButtonProperty2; } public void SetPropertyForType(AnnotHandlerEventArgs Args, AnnotAttribEvent e) { currentPanel = null; if (Args == null) { SetMeasurePanel(currentPanel); return; } switch (Args.EventType) { case AnnotArgsType.LineMeasure: MultilineProperty multilineProperty = new MultilineProperty(); currentPanel = multilineProperty; break; case AnnotArgsType.PolyLineMeasure: PolygonalProperty polygonalProperty = new PolygonalProperty(); currentPanel = polygonalProperty; break; case AnnotArgsType.PolygonMeasure: RectanglesProperty rectanglesProperty = new RectanglesProperty(); currentPanel = rectanglesProperty; break; default: break; } SetMeasurePanel(currentPanel); } private void SetMeasurePanel(UIElement newChild) { MeasurePropertyPanel.Child = newChild; } } }