private static void maxValueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { DoubleUpDownWithNull numericUpDown = ((DoubleUpDownWithNull)d); numericUpDown.CoerceValue(MinValueProperty); numericUpDown.CoerceValue(ValueProperty); }
private static void valueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { DoubleUpDownWithNull numericUpDown = (DoubleUpDownWithNull)d; ValueChangedWithNullEventArgs ea = new ValueChangedWithNullEventArgs(DoubleUpDownWithNull.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 == null ? string.Empty : e.NewValue.ToString(); }
private static object coerceIncrementCallback(DependencyObject d, object value) { DoubleUpDownWithNull numericUpDown = ((DoubleUpDownWithNull)d); double i = numericUpDown.MaxValue - numericUpDown.MinValue; if ((double)value > i) { return(i); } return(value); }