internal Viewport2dDeferredPanningProxy(Viewport2D viewport) : base(viewport.HostElement, viewport.Plotter2D) { viewport.PropertyChanged += viewport_PropertyChanged; viewport.PanningStateChanged += viewport_PanningStateChanged; this.viewport = viewport; }
public override DataRect Apply( DataRect previousDataRect, DataRect proposedDataRect, Viewport2D viewport ) { DataRect dataRect = proposedDataRect.WithY(other.Visible.YMin, other.Visible.YMax); if (dataRect != other.Visible) { other.Visible = dataRect; } return proposedDataRect; }
public InjectedPlotter() : base(PlotterLoadMode.Empty) { ViewportPanel = new Canvas(); Grid.SetColumn(ViewportPanel, 1); Grid.SetRow(ViewportPanel, 1); Viewport = new Viewport2D(ViewportPanel, this); }
public PhysicalRectAnimation(Viewport2D viewport, Point initialMousePos) { this.from = viewport.Visible; this.viewport = viewport; this.initialMousePos = initialMousePos; initialTransform = viewport.Transform; position = from.Location.ToVector(); }
private void InitViewport() { viewportPanel = new Canvas(); Grid.SetColumn(viewportPanel, 1); Grid.SetRow(viewportPanel, 1); viewport = new Viewport2D(viewportPanel, this); if (LoadMode != PlotterLoadMode.Empty) { MainGrid.Children.Add(viewportPanel); } }
public virtual void OnPlotterAttached(Plotter plotter) { this.plotter = (Plotter2D)plotter; viewport = this.plotter.Viewport; if (!IsMarkersHost) { plotter.CentralGrid.Children.Add(hostingCanvas); } if (Parent == null) { hostingCanvas.Children.Add(this); } this.plotter.Viewport.PropertyChanged += Viewport_PropertyChanged; }
public Rect Apply(Rect oldVisible, Rect newVisible, Viewport2D viewport) { if (XRange != null) { newVisible.X = XRange.Start; newVisible.Width = XRange.End - XRange.Start; } if (YRange != null) { newVisible.Y = YRange.Start; newVisible.Height = YRange.End - YRange.Start; } return newVisible; }
public override DataRect Apply(DataRect previousDataRect, DataRect proposedDataRect, Viewport2D viewport) { if (!proposedDataRect.IsEmpty) { if (XRange != null) { proposedDataRect.XMin = Math.Max(XRange.Start, proposedDataRect.XMin); proposedDataRect.Width = XRange.End - XRange.Start; } if (YRange != null) { proposedDataRect.YMin = YRange.Start; proposedDataRect.Height = YRange.End - YRange.Start; } return proposedDataRect; } return previousDataRect; }
public EqualXConstraint(Viewport2D other) { this.other = other; }
public XValueTextMarker(Viewport2D ct) { this.ct = ct; }
/// <summary> /// Initializes a new instance of the <see cref="PointsGraphBase"/> class. /// </summary> protected PointsGraphBase() { Viewport2D.SetIsContentBoundsHost(this, true); }
protected abstract void UpdateScrollBar(Viewport2D viewport);
public XConverter( Viewport2D viewport ) { this.viewport = viewport; }
protected override void OnPlotterDetaching(Plotter plotter) { base.OnPlotterDetaching(plotter); viewport.PropertyChanged -= OnViewportPropertyChanged; viewport = null; GetHostPanel(plotter).Children.Remove(this); plotter2D = null; }
protected override void OnPlotterAttached(Plotter plotter) { base.OnPlotterAttached(plotter); plotter2D = (Plotter2D)plotter; GetHostPanel(plotter).Children.Add(this); viewport = plotter2D.Viewport; viewport.PropertyChanged += OnViewportPropertyChanged; }
public override DataRect Apply(DataRect previousDataRect, DataRect proposedDataRect, Viewport2D viewport) { return DataRect.Create(proposedDataRect.XMin, 0, proposedDataRect.XMax, 1); }
protected override void OnRenderCore(DrawingContext dc, RenderState state) { if (Marker == null) { return; } if (DataSource == null) // No data is specified { if (canvas != null) { foreach (UIElement child in canvas.Children) { unused.Add(child); } canvas.Children.Clear(); } } else // There is some data { int index = 0; var transform = GetTransform(); using (IPointEnumerator enumerator = DataSource.GetEnumerator(GetContext())) { Point point = new Point(); DataRect bounds = DataRect.Empty; while (enumerator.MoveNext()) { enumerator.GetCurrent(ref point); enumerator.ApplyMappings(Marker); if (index >= canvas.Children.Count) { UIElement newMarker; if (unused.Count > 0) { newMarker = unused[unused.Count - 1]; unused.RemoveAt(unused.Count - 1); } else { newMarker = Marker.CreateMarker(); } canvas.Children.Add(newMarker); } Marker.SetMarkerProperties(canvas.Children[index]); bounds.Union(point); Point screenPoint = point.DataToScreen(transform); Marker.SetPosition(canvas.Children[index], screenPoint); index++; } Viewport2D.SetContentBounds(this, bounds); while (index < canvas.Children.Count) { unused.Add(canvas.Children[index]); canvas.Children.RemoveAt(index); } } } }