private static object CoerceMaximum(DependencyObject element, object value) { YearControl adjCtl = (YearControl)element; int newMax = (int)value > adjCtl.Minimum ? (int)value : adjCtl.Minimum; return(newMax); }
private static object CoerceValue(DependencyObject element, object value) { int newValue = (int)value; YearControl adjCtl = (YearControl)element; newValue = newValue > adjCtl.Maximum ? adjCtl.Maximum : newValue; newValue = newValue < adjCtl.Minimum ? adjCtl.Minimum : newValue; return(newValue); }
public static void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { YearControl adjCtl = (YearControl)sender; adjCtl.UpdateVisibles(); }