private static void maxValueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { DoubleUpDown numericUpDown = ((DoubleUpDown)d); numericUpDown.CoerceValue(MinValueProperty); numericUpDown.CoerceValue(ValueProperty); }
private static void valueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { DoubleUpDown numericUpDown = (DoubleUpDown)d; ValueChangedEventArgs ea = new ValueChangedEventArgs(DoubleUpDown.ValueChangedEvent, d, (double)e.OldValue, (double)e.NewValue); numericUpDown.RaiseEvent(ea); //if (ea.Handled) numericUpDown.Value = (double)e.OldValue; //else numericUpDown.PART_TextBox.Text = e.NewValue.ToString(); }
private static object coerceIncrementCallback(DependencyObject d, object value) { DoubleUpDown numericUpDown = ((DoubleUpDown)d); double i = numericUpDown.MaxValue - numericUpDown.MinValue; if ((double)value > i) { return(i); } return(value); }