If you bind to a view-model property that is a nullable double (or int) how do you allow a user to specify nothing.
I'm looked into validation but I can't see how I could get that to help.
It seems like if a textbox is blanked out WPF sees it as an empty string and then doesn't put the into the vm proptery.
So 2 ways around it I can think of is:
Any other ideas? Am I missing something?
cody
Set TargetNullValue to the empty string on the binding. When WPF sees this value, it will set the source to null instead of trying to convert the value.
{Binding TargetNullValue=''}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With