Cannot associate empty null decimal text box with MVVM backlight

Is there any solution to bind a text box to a decimal value with a null value? Whenever you leave a text field blank, the binding is not updated. I know that one solution is to use a string property, but I really don't want to do this.

+5
source share
2 answers

You can do the trick using TargetNullValue .

<TextBox Text="{Binding Value, TargetNullValue=''}"/>
+14
source

If simple bindings fail, you can always use converter .

+2
source

All Articles