diff --git a/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs b/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs index 2e51d231..b2967d9b 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs @@ -82,6 +82,10 @@ public class NumericUpDown : Control { SetCurrentValue(ValueProperty, value); } + else + { + SetText(true); + } } private void TextBox_TextChanged(object sender, TextChangedEventArgs e) @@ -116,6 +120,7 @@ public class NumericUpDown : Control if (_textBox.IsFocused && !IsReadOnly) { Value += e.Delta > 0 ? Increment : -Increment; + SetText(true); e.Handled = true; } } @@ -164,9 +169,9 @@ public class NumericUpDown : Control }); } - private void SetText() + private void SetText(bool force = false) { - if (_textBox != null) + if (_textBox != null && (!_textBox.IsFocused || force)) { _textBox.Text = CurrentText; _textBox.Select(_textBox.Text.Length, 0);