示例#1
0
        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;
            }
        }
示例#2
0
        //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();
                }
            }
        }