示例#1
0
        private static void OnStrokeThicknessPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            CartesianStrokedAnnotation annotation = sender as CartesianStrokedAnnotation;

            annotation.Presenter.StrokeThickness = (double)e.NewValue;
            var model = annotation.Model as IStrokedAnnotationModel;

            if (model != null)
            {
                model.StrokeThickness = annotation.Presenter.StrokeThickness;
            }
        }
示例#2
0
        private static void OnStrokeDashArrayChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            CartesianStrokedAnnotation annotation = sender as CartesianStrokedAnnotation;

            annotation.Presenter.StrokeDashArray = (e.NewValue as DoubleCollection).Clone();
            var model = annotation.Model as IStrokedAnnotationModel;

            if (model != null)
            {
                model.DashPatternLength = annotation.Presenter.StrokeDashArray.Sum();
                if (annotation.Presenter.StrokeDashArray.Count % 2 == 1)
                {
                    model.DashPatternLength *= 2;
                }
            }
        }
示例#3
0
        private static void OnStrokePropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            CartesianStrokedAnnotation annotation = sender as CartesianStrokedAnnotation;

            annotation.Presenter.Stroke = e.NewValue as Brush;
        }