private bool CheckDataInUpdateBounds(NotifyCollectionChangedEventArgs e, PointChartBase chart) { var dataToPoint = chart.DataSource.DataToPoint; if (dataToPoint == null) { return(true); } if (e.NewItems != null) { foreach (var dataItem in e.NewItems) { var point = dataToPoint(dataItem); if (increasedVisible.Contains(point)) { return(true); } } } if (e.OldItems != null) { foreach (var dataItem in e.OldItems) { var point = dataToPoint(dataItem); if (increasedVisible.Contains(point)) { return(true); } } } return(false); }
public override void OnUpdate(NotifyCollectionChangedEventArgs e, PointChartBase chart) { switch (e.Action) { case NotifyCollectionChangedAction.Add: chart.OnAdded(e); break; case NotifyCollectionChangedAction.Move: chart.OnMoved(e); break; case NotifyCollectionChangedAction.Remove: chart.OnRemoved(e); break; case NotifyCollectionChangedAction.Replace: chart.OnReplaced(e); break; case NotifyCollectionChangedAction.Reset: chart.OnReset(); break; } }
private bool CheckDataInUpdateBounds(NotifyCollectionChangedEventArgs e, PointChartBase chart) { var dataToPoint = chart.DataSource.DataToPoint; if (dataToPoint == null) return true; if (e.NewItems != null) { foreach (var dataItem in e.NewItems) { var point = dataToPoint(dataItem); if (increasedVisible.Contains(point)) return true; } } if (e.OldItems != null) { foreach (var dataItem in e.OldItems) { var point = dataToPoint(dataItem); if (increasedVisible.Contains(point)) return true; } } return false; }
private static void OnItemsPanelTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PointChartBase chart = (PointChartBase)d; if (e.NewValue != null) { chart.OnItemsPanelChanged(); } }
private static void OnIndependentValueMappingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PointChartBase owner = (PointChartBase)d; string path = (string)e.NewValue; if (path == null) { owner.IndependentValueBinding = null; } else { owner.IndependentValueBinding = new Binding(path); } }
private static object CoerceIndependentValuePath(DependencyObject d, object value) { PointChartBase chart = (PointChartBase)d; string path = (string)value; if (!String.IsNullOrEmpty(path)) { return(value); } if (chart.independentValueBinding != null) { return(chart.independentValueBinding.Path.Path); } return(null); }
public override void OnUpdate(NotifyCollectionChangedEventArgs e, PointChartBase chart) { switch (e.Action) { case NotifyCollectionChangedAction.Add: case NotifyCollectionChangedAction.Move: case NotifyCollectionChangedAction.Remove: case NotifyCollectionChangedAction.Replace: if (CheckDataInUpdateBounds(e, chart)) { base.OnUpdate(e, chart); } break; case NotifyCollectionChangedAction.Reset: base.OnUpdate(e, chart); break; } }
public override void OnUpdate(NotifyCollectionChangedEventArgs e, PointChartBase chart) { switch (e.Action) { case NotifyCollectionChangedAction.Add: case NotifyCollectionChangedAction.Move: case NotifyCollectionChangedAction.Remove: case NotifyCollectionChangedAction.Replace: if (CheckDataInUpdateBounds(e, chart)) { base.OnUpdate(e, chart); } break; case NotifyCollectionChangedAction.Reset: base.OnUpdate(e, chart); break; default: break; } }
public override void OnUpdate(NotifyCollectionChangedEventArgs e, PointChartBase chart) { switch (e.Action) { case NotifyCollectionChangedAction.Add: chart.OnAdded(e); break; case NotifyCollectionChangedAction.Move: chart.OnMoved(e); break; case NotifyCollectionChangedAction.Remove: chart.OnRemoved(e); break; case NotifyCollectionChangedAction.Replace: chart.OnReplaced(e); break; case NotifyCollectionChangedAction.Reset: chart.OnReset(); break; default: break; } }
private static void OnDataSourceReplaced(DependencyObject d, DependencyPropertyChangedEventArgs e) { PointChartBase owner = (PointChartBase)d; owner.OnDataSourceReplaced((PointDataSourceBase)e.OldValue, (PointDataSourceBase)e.NewValue); }
public override void OnPlotterDetached(Plotter2D plotter, PointChartBase chart) { plotter.Viewport.PropertyChanged -= Viewport_PropertyChanged; this.chart = null; }
public virtual void OnPlotterDetached(Plotter2D plotter, PointChartBase chart) { }
public override void OnPlotterAttached(Plotter2D plotter, PointChartBase chart) { this.chart = chart; increasedVisible = plotter.Visible.ZoomOutFromCenter(2.0); plotter.Viewport.PropertyChanged += Viewport_PropertyChanged; }
public virtual void OnPlotterAttached(Plotter2D plotter, PointChartBase chart) { }
public abstract void OnUpdate(NotifyCollectionChangedEventArgs e, PointChartBase chart);
private static void OnItemsSourceReplaced(DependencyObject d, DependencyPropertyChangedEventArgs e) { PointChartBase chart = (PointChartBase)d; chart.OnItemsSourceReplaced(e); }