I’ve been struggling with this problem for some time and it seems I can’t come up with a specific workaround - I have a TextBox that is bound to the decimal system, and the binding has UpdateSourceTrigger set in PropertyChanged and so on as needed (LostFocus in this case will not work ) The default behavior, while I'm sure, somehow explainable, is unacceptable for my purposes, so I tried the following StringFormat, which I thought fixed the problem, but only partially, and now I'm looking for something more specific. My original fix was to add a string binding format ... in my case it was
StringFormat={0:
so when entering something like .12345 or 1.5, the solution works fine, however, if I type .01234 as soon as I press the null key, it deletes the decimal line I just printed ... which for obvious reasons would be with data entry point of view. I hope my familiarity with string formatting is simply missing. Random script. I will have a displayed property - a string, and the setter and getter just convert to decimal, but this seems like a hacker solution.
Thanks!
Aj
source share