private static void ChangeImageElementTransform(DependencyObject source, DependencyPropertyChangedEventArgs e) { try { RulerAdorner adornerView = source as RulerAdorner; adornerView._pl.LayoutTransform = adornerView.ImageElementTransform.Inverse as Transform; } catch { } }
private static void ChangeRoiDetails(DependencyObject source, DependencyPropertyChangedEventArgs e) { try { RulerAdorner roi = (source as RulerAdorner); roi.refreshDetails(); } catch { } }
private static void ChangePathPoints(DependencyObject source, DependencyPropertyChangedEventArgs e) { RulerAdorner roi = null; try { roi = (source as RulerAdorner); roi._pathPoints.CollectionChanged -= roi._pathPoints_CollectionChanged; roi._pathPoints = (ObservableCollection <Point>)e.NewValue; roi._pathPoints.CollectionChanged += roi._pathPoints_CollectionChanged; roi.drawElements(); } catch { if (roi != null) { roi._pathPoints = new ObservableCollection <Point>(); } } }