//DependencyProperty.Register("DisplayMode", typeof(DisplayMode), typeof(PieChartLabel), new FrameworkPropertyMetadata(DisplayMode.ArcMidpoint, FrameworkPropertyMetadataOptions.AffectsArrange)); private static void DisplayModePropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { PieChartLabel label = obj as PieChartLabel; if (label != null) { label.InvalidateArrange(); } }
//public static readonly DependencyProperty GeometryProperty = PieDataPoint.GeometryProperty.AddOwner(typeof(PieChartLabel), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsParentMeasure | FrameworkPropertyMetadataOptions.AffectsArrange, GeometryPropertyChanged)); private static void GeometryPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { PieChartLabel label = obj as PieChartLabel; if (label != null) { bool isArcSmall; PieChartHelper.GetPieChartInfo(e.NewValue as Geometry, out label.center, out label.arcMidpoint, out isArcSmall); label.IsArcSmall = isArcSmall; label.InvalidateArrange(); FrameworkElement fe = label.Parent as FrameworkElement; if (fe != null) { fe.InvalidateMeasure(); } } }