diff --git a/source/NumericUpDownLib/Base/AbstractBaseUpDown.cs b/source/NumericUpDownLib/Base/AbstractBaseUpDown.cs index f8c720a..1d1d444 100644 --- a/source/NumericUpDownLib/Base/AbstractBaseUpDown.cs +++ b/source/NumericUpDownLib/Base/AbstractBaseUpDown.cs @@ -386,7 +386,11 @@ public bool IsIncDecButtonsVisible public T Value { get { return (T)GetValue(ValueProperty); } - set { SetValue(ValueProperty, value); } + set + { + SetValue(ValueProperty, value); + LastEditingNumericValue = value; + } } /// @@ -435,19 +439,19 @@ public byte DisplayLength { get { return (byte)GetValue(DisplayLengthProperty); } set { SetValue(DisplayLengthProperty, value); } - } - + } + /// /// Gets/sets the MinWidth for the control. The width of the textbox portion of /// the control is expanded to fill the MinWidth value while the width of the /// UpDown buttons are auto sized. /// - public virtual double MinWidth - { - get { return (double)GetValue(MinWidthProperty); } - set { SetValue(MinWidthProperty, value); } - } - + public virtual double MinWidth + { + get { return (double)GetValue(MinWidthProperty); } + set { SetValue(MinWidthProperty, value); } + } + /// /// Gets/sets whether the textbox portion of the numeric up down control /// can go grow and shrink with its input or whether it should stay with @@ -962,7 +966,6 @@ private void _PART_TextBox_LostFocus(object sender, RoutedEventArgs e) if (IsUpdateValueWhenLostFocus && IsValueValid) { Value = FormatText(_PART_TextBox.Text, true); - LastEditingNumericValue = Value; } } } @@ -1112,7 +1115,6 @@ private void textBox_PreviewKeyDown(object sender, KeyEventArgs e) } T OldValue = Value; Value = FormatText(_PART_TextBox.Text, true); - LastEditingNumericValue = Value; // force to raise value changed event to tigger re write /re-set for application if (OldValue.Equals(Value) && isCtrlDown)