Decimal in clamped TextBox
I'm implementing a numerical TextBox that may clamp entered values between a min and max value. I achieved this by overriding the MetaData for the Text property with a TwoWay binding by default and an OnTextChanged handler.
One of the hurdles along the way was partially entered values such as
The issue I have is that I'm unable to enter a decimal into the TextBox despite being allowed by the regex
Here is my on changed handler.
What changes can I make to allow for the entry of a decimal point?
Edit: I've also realised that I cannot enter
One of the hurdles along the way was partially entered values such as
-, 0., 1.3, etc. I overcame this with a regex. The issue I have is that I'm unable to enter a decimal into the TextBox despite being allowed by the regex
^(-?\d+\.|-0?)$.Here is my on changed handler.
What changes can I make to allow for the entry of a decimal point?
Edit: I've also realised that I cannot enter
-0, subsequently -0.