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; } }
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; } } }
private static void OnStrokePropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { CartesianStrokedAnnotation annotation = sender as CartesianStrokedAnnotation; annotation.Presenter.Stroke = e.NewValue as Brush; }