private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { NumericUpDown numericUpDown = (NumericUpDown)d; numericUpDown.CoerceValue(NumericUpDown.ValueProperty); numericUpDown.CoerceValue(NumericUpDown.MaximumProperty); numericUpDown.Value = (double?)NumericUpDown.CoerceValue(numericUpDown, numericUpDown.Value); numericUpDown.OnMinimumChanged((double)e.OldValue, (double)e.NewValue); numericUpDown.EnableDisableUpDown(); }
private void OnTextChanged(object sender, TextChangedEventArgs e) { double num; if (string.IsNullOrEmpty(((TextBox)sender).Text)) { this.Value = null; return; } if (this._manualChange && this.ValidateText(((TextBox)sender).Text, out num)) { this.Value = (double?)NumericUpDown.CoerceValue(this, num); e.Handled = true; } }
private void ChangeValueBy(double difference) { double valueOrDefault = this.Value.GetValueOrDefault() + difference; this.Value = new double?((double)NumericUpDown.CoerceValue(this, valueOrDefault)); }