private static void minChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { SpinnerBase <T> control = (SpinnerBase <T>)d; Nullable <T> min = (Nullable <T>)e.NewValue; control.Value = coerceValue(control.Value, control.Max, min); }
protected virtual void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { SpinnerBase <T> control = (SpinnerBase <T>)d; Nullable <T> value = (Nullable <T>)e.NewValue; control.valueTextBoxBase.Text = value == null ? "" : value.Value.ToString(); }
private static void isReadOnlyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { SpinnerBase <T> control = (SpinnerBase <T>)d; bool isReadOnly = (bool)e.NewValue; control.valueTextBoxBase.IsReadOnly = isReadOnly; control.upButtonBase.IsEnabled = !isReadOnly; control.downButtonBase.IsEnabled = !isReadOnly; }
static void timer_Tick(Object sender, EventArgs e) { SpinnerBase <T> spinner = (SpinnerBase <T>)(sender as VideoPlayerControl.Timers.DefaultTimer).Tag; spinner.Dispatcher.BeginInvoke(new Action(() => { if (spinner.downButtonBase.IsPressed == true) { spinner.subtractValue(); } else if (spinner.upButtonBase.IsPressed == true) { spinner.addValue(); } })); timer.Interval = repeatDelayMS; }
private static void textAlignment_PropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { SpinnerBase <T> control = (SpinnerBase <T>)d; control.valueTextBoxBase.TextAlignment = (TextAlignment)e.NewValue; }
private static void valueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { SpinnerBase <T> control = (SpinnerBase <T>)d; control.OnValueChanged(d, e); }