/// <summary> /// Initializes a new instance of the PieDataPoint class. /// </summary> public PieDataPoint() { if (DesignerProperties.GetIsInDesignMode(this)) { // Create default design-mode-friendly settings ActualRatio = 0.2; SizeChanged += delegate(object sender, SizeChangedEventArgs e) { // Handle SizeChanged event to update Geometry dynamically PieSeries.UpdatePieDataPointGeometry(this, e.NewSize.Width, e.NewSize.Height); }; } }
/// <summary> /// Called when the value of the ActualOffsetRatioProperty property changes. /// </summary> /// <param name="oldValue">The value to be replaced.</param> /// <param name="newValue">The new value.</param> private void OnActualOffsetRatioPropertyChanged(double oldValue, double newValue) { RoutedPropertyChangedEventHandler <double> handler = this.ActualOffsetRatioChanged; if (handler != null) { handler(this, new RoutedPropertyChangedEventArgs <double>(oldValue, newValue)); } if (DesignerProperties.GetIsInDesignMode(this)) { PieSeries.UpdatePieDataPointGeometry(this, ActualWidth, ActualHeight); } }