void IPlotterElement.OnPlotterAttached(Plotter plotter) { if (this.plotter == null) { this.plotter = plotter; Plotter2D plotter2d = plotter as Plotter2D; plotter2d.Viewport.VisibleChanged += OnViewportConfigurationChanged; plotter2d.Viewport.OutputChanged += OnViewportConfigurationChanged; plotter2d.Viewport.TransformChanged += OnViewportConfigurationChanged; Panel panel = GetPanelByPlacement(placement); //panel.Children.Add( this); if (placement == AxisPlacement.Right || placement == AxisPlacement.Left) { panel.Children.Add(this); } else { panel.Children.Insert(0, this); } using (axisControl.OpenUpdateRegion()) { axisControl.Transform = plotter2d.Viewport.Transform; axisControl.Range = CreateRangeFromRect(plotter2d.Viewport.Visible.ViewportToData(plotter2d.Viewport.Transform)); } } }
protected override void OnPlotterAttached(Plotter2D plotter) { plotter.Viewport.PropertyChanged += OnViewportPropertyChanged; Panel panel = GetPanelByPlacement(Placement); if (panel != null) { int index = GetInsertionIndexByPlacement(Placement, panel); panel.Children.Insert(index, this); } using (axisControl.OpenUpdateRegion(true)) { UpdateAxisControl(plotter); } }
void IPlotterElement.OnPlotterAttached(Plotter plotter) { this.plotter = plotter; Plotter2D plotter2d = plotter as Plotter2D; plotter2d.Viewport.PropertyChanged += OnViewportPropertyChanged; Panel panel = GetPanelByPlacement(placement); panel.Children.Add(this); using (axisControl.OpenUpdateRegion()) { axisControl.Transform = plotter2d.Viewport.Transform; axisControl.Range = CreateRangeFromRect(plotter2d.Viewport.Visible.ViewportToData(plotter2d.Viewport.Transform)); } }