private static void OnSelectionPaletteChanged(DependencyObject target, DependencyPropertyChangedEventArgs args) { RadChartBase chart = target as RadChartBase; chart.selectionPaletteCache = args.NewValue as ChartPalette; chart.ProcessPaletteChanged(true); }
private static void UpdateSelectionPalette(RadChartBase chart, PredefinedPaletteName paletteName) { if (chart.GetValue(RadChartBase.SelectionPaletteProperty) == null) { chart.selectionPaletteCache = ChartPalettes.FromPredefinedName(paletteName); chart.ProcessPaletteChanged(true); } }
internal void Attach(RadChartBase chartBase) { this.chart = chartBase; this.Element.presenter = this; this.OnAttached(); Canvas.SetZIndex(this, this.DefaultZIndex + this.userZIndex); }
private static void OnMinZoomPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { RadChartBase chart = sender as RadChartBase; chart.minZoomCache = (Size)e.NewValue; chart.UpdateZoom(chart.zoomCache); }
/// <summary> /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase" /> instance. /// </summary> protected override void OnDetached(RadChartBase oldChart) { RadCartesianChart chart = oldChart as RadCartesianChart; this.model.DetachAxis(chart.HorizontalAxis.model); this.model.DetachAxis(chart.VerticalAxis.model); base.OnDetached(oldChart); }
internal void AddListener(RadChartBase chart) { int index = this.charts.IndexOf(chart); if (index < 0) { this.charts.Add(chart); } }
/// <summary> /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase" /> instance. /// </summary> protected override void OnDetached(RadChartBase oldChart) { base.OnDetached(oldChart); if (oldChart != null) { (oldChart.chartArea as ChartAreaModelWithAxes).RemoveAnnotation(this.Model); } }
internal void Attach(RadChartBase chartBase) { this.chart = chartBase; this.drawWithComposition = this.chart.ContainerVisualsFactory.CanDrawContainerVisual(this); this.Element.presenter = this; this.OnAttached(); Canvas.SetZIndex(this, this.DefaultZIndex + this.userZIndex); }
private static void OnZoomPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { RadChartBase chart = sender as RadChartBase; if (chart.IsInternalPropertyChange) { return; } chart.UpdateZoom((Size)e.NewValue); }
private static void OnScrollOffsetPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { RadChartBase chart = sender as RadChartBase; if (chart.IsInternalPropertyChange) { return; } chart.UpdateScrollOffset((Point)e.NewValue); }
private static void OnEmptyContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RadChartBase chart = d as RadChartBase; if (chart.IsInternalPropertyChange) { return; } chart.userEmptyContent = e.NewValue != null; }
internal void Detach() { RadChartBase oldChart = this.chart; this.chart = null; this.Element.presenter = null; this.OnDetached(oldChart); // invalidate the layout context and isPalette applied flag this.InvalidateCore(); }
/// <summary> /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance. /// </summary> protected override void OnDetached(RadChartBase oldChart) { base.OnDetached(oldChart); if (oldChart != null) { foreach (var item in this.LegendItems) { oldChart.LegendInfosInternal.Remove(item); } } }
/// <summary> /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase" /> instance. /// </summary> protected override void OnDetached(RadChartBase oldChart) { base.OnDetached(oldChart); if (oldChart != null) { RadPolarChart chart = oldChart as RadPolarChart; this.AxisModel.DetachAxis(chart.PolarAxis.model); this.AxisModel.DetachAxis(chart.RadialAxis.model); } // TODO: Raise exception as needed. }
/// <summary> /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase" /> instance. /// </summary> protected override void OnDetached(RadChartBase oldChart) { if (this.horizontalAxisCache != null) { this.RemoveAxisFromChart(this.horizontalAxisCache, oldChart, false); } if (this.verticalAxisCache != null) { this.RemoveAxisFromChart(this.verticalAxisCache, oldChart, false); } base.OnDetached(oldChart); }
private static void OnPaletteChanged(DependencyObject target, DependencyPropertyChangedEventArgs args) { RadChartBase chart = target as RadChartBase; chart.paletteCache = args.NewValue as ChartPalette; if (chart.paletteCache == null) { UpdatePalette(chart, chart.PaletteName); } chart.ProcessPaletteChanged(true); }
/// <summary> /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance. /// </summary> protected override void OnDetached(RadChartBase oldChart) { base.OnDetached(oldChart); if (oldChart != null) { var oldCharArea = oldChart.chartArea as ChartAreaModelWithAxes; if (oldCharArea != null) { oldCharArea.SetGrid(null); } } // TODO: Consider rasing exception. }
private void AddAxisToChart(CartesianAxis axis, RadChartBase chart) { if (chart == null) { this.unattachedAxes.Add(axis); } else { if (axis.chart == null) { chart.OnPresenterAdded(axis); } axis.linkedSeriesCount++; } }
/// <summary> /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance. /// </summary> protected override void OnDetached(RadChartBase oldChart) { base.OnDetached(oldChart); if (oldChart != null) { var oldChartArea = oldChart.chartArea as ChartAreaModelWithAxes; if (oldChartArea != null) { oldChartArea.SetGrid(null); } } // TODO: Consider throwing Exception if oldChart is not valid. }
// TODO: Check whether we should raise exception if the oldChart is invalid. /// <summary> /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance. /// </summary> protected override void OnDetached(RadChartBase oldChart) { this.model.labels.Clear(); this.model.ticks.Clear(); base.OnDetached(oldChart); if (oldChart != null) { var oldChartArea = oldChart.chartArea as ChartAreaModelWithAxes; if (oldChartArea != null) { oldChartArea.RemoveAxis(this.model); } } }
/// <summary> /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance. /// </summary> protected override void OnDetached(RadChartBase oldChart) { base.OnDetached(oldChart); if (oldChart != null) { if (oldChart.chartArea != null && oldChart.chartArea.Series != null) { oldChart.chartArea.Series.Remove(this.Model); if (this.labelLayer != null) { oldChart.RemoveLabelLayer(this); this.labelLayer = null; } } //// TODO: Consider throwing exception if needed. } }
internal void UpdateSeriesClip() { if (!this.ClipToPlotArea || !this.IsRendered || !RadChartBase.IsRedstone2()) { return; } foreach (var path in this.renderSurface.Children.OfType <Path>()) { Point topLeft; if (path.Data.Bounds != defaultRect) { topLeft = new Point(path.Data.Bounds.X, path.Data.Bounds.Y); } else { topLeft = path.GetTopLeft(); topLeft.X = topLeft.X - this.GetStrokeThicknessAdjustment(); topLeft.Y = topLeft.Y - this.GetStrokeThicknessAdjustment(); } TransformGroup transform = path.RenderTransform as TransformGroup; Point translatePoint = new Point(); if (transform != null) { foreach (var tr in transform.Children) { TranslateTransform translateTransform = tr as TranslateTransform; if (translateTransform != null) { translatePoint.X += translateTransform.X; translatePoint.Y += translateTransform.Y; } } } path.Clip = new RectangleGeometry() { Rect = new Rect(0, 0, this.chart.PlotAreaClip.Width + this.chart.PlotAreaClip.X - topLeft.X - translatePoint.X, this.chart.PlotAreaClip.Height + this.chart.PlotAreaClip.Y - topLeft.Y - translatePoint.Y) }; } }
/// <summary> /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance. /// </summary> protected override void OnDetached(RadChartBase oldChart) { base.OnDetached(oldChart); if (oldChart != null) { foreach (Element element in this.Elements) { element.presenter = null; } if (oldChart.chartArea != null && oldChart.chartArea.Series != null) { oldChart.chartArea.Series.Remove(this.signalModel); } } // TODO: consider raising exception if oldChart is invalid. }
private static void OnSeriesProviderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RadChartBase chart = d as RadChartBase; ChartSeriesProvider oldProvider = e.OldValue as ChartSeriesProvider; if (oldProvider != null) { oldProvider.RemoveListener(chart); } ChartSeriesProvider newProvider = e.NewValue as ChartSeriesProvider; if (newProvider != null) { newProvider.AddListener(chart); } chart.UpdateDynamicSeries(); }
private void RemoveAxisFromChart(CartesianAxis axis, RadChartBase chart, bool detachFromSeries) { if (chart == null) { this.unattachedAxes.Remove(axis); } else { if (axis.linkedSeriesCount == 1) { chart.OnPresenterRemoved(axis); } axis.linkedSeriesCount--; } if (!detachFromSeries) { this.unattachedAxes.Add(axis); } }
/// <summary> /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance. /// </summary> protected override void OnDetached(RadChartBase oldChart) { base.OnDetached(oldChart); if (oldChart != null) { foreach (var element in this.Elements) { element.presenter = null; } if (oldChart.chartArea != null && oldChart.chartArea.Series != null) { oldChart.chartArea.Series.Remove(this.lowerBandModel); } } else { // TODO: consider throwing exception. } }
internal ChartBehaviorCollection(RadChartBase owner) { this.owner = owner; }
internal PresenterCollection(RadChartBase control) { this.chart = control; }
internal void Attach(RadChartBase owner) { this.chart = owner; this.OnAttached(); }
internal void Detach() { this.OnDetached(); this.chart = null; }