Ejemplo n.º 1
0
        /// <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);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the PieDataPoint.
        /// </summary>
        public PieDataPoint()
        {
            DefaultStyleKey = typeof(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);
                };
            }
        }