If you bind to a view-model property, which is a nullable double (or int), how do you allow the user to not specify anything.
I am studying validation, but I canβt figure out how to help me.
It seems that if the text field is obscured, WPF sees it as an empty string, and then does not put it in the vm version.
Thus, I can think of two ways:
- The vm value is the string that validated and updated the support model.
- special code that does not indicate a value (in my case, dbl should not be negative, so -9 may be null ... but I don't like the idea of ββmagic numbers)
Any other ideas? Did I miss something?
Cody
source share