wpf-currency-textbox
wpf-currency-textbox copied to clipboard
Feature/maximum and minimum value
Added option to put a minimum and maximum value on the input. Should not break any existing code because the properties default to decimal.MinValue and decimal.MaxValue. Also added a .gitattribute file to fix line ending problems.
It seems like having a max/min value would be a jarring experience for the user.
Example:
Let's say the maximum value is 10.00
and the user types 1234:
-
0.01
-
0.12
-
1.23
-
10.00
: the user would've expected to see12.34
... they might think they mis-typed the 4 and try again. Also they can't just backspace to try again since the2
was changed to a0
.
If we instead use validation to show an error if the value is too large then interaction behaves as expected and the user is informed why their value is invalid.
I like that idea. I also noticed it was a little clunky. For example, if you set a minimum of 0 and press '-', it immediately sets the number to 0, which is probably unexpected to the user.
Validation is probably a better way to go.