private static void OnValueChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) { SpinControl control = (SpinControl)obj; RoutedPropertyChangedEventArgs <int?> e = new RoutedPropertyChangedEventArgs <int?>( (int?)args.OldValue, (int?)args.NewValue, ValueChangedEvent); control.OnValueChanged(e); }
private static object CoerceValue(DependencyObject element, object value) { int? newValue = (int?)value; SpinControl control = (SpinControl)element; return(newValue); }