02-27-2015 07:50 AM
Hi,
I have a ni:NumericTextBoxDouble binded OneWayToSource to a Property. How do I set the Initial Value, which is show (an set) by starting up my program? Now it is showing 0.00.
<ni:NumericTextBoxDouble
x:Name="YMax"
Value="{Binding Path=MyYMax, Mode=OneWayToSource, ValidatesOnExceptions=True }"
InteractionMode="ArrowKeys, ScrollWheel, TextInput"
Width="58"
Margin="0,10"
Cursor="IBeam"> <ni:NumericTextBoxDouble.ValueFormatter> <ni:GeneralValueFormatter Format="0.00" ShortFormat="{x:Null}"/> </ni:NumericTextBoxDouble.ValueFormatter> </ni:NumericTextBoxDouble>
Solved! Go to Solution.
02-27-2015 10:36 AM
I believe you can set FallbackValue
to get a default value when using a OneWayToSource
binding.
03-02-2015 01:34 AM
ni:NumericTextBoxDouble doesn't seem to have a FallbackValue property...
03-02-2015 08:25 AM
I solved the Issue with the following Workaround:
I set the Binding type to TwoWay, and gave the Property to a default value. It works, but not a perfect model of my data handling.
03-02-2015 09:15 AM
To clarify, I meant the FallbackValue
property on Binding
itself:
<ni:NumericTextBoxDouble Value="{Binding Path=MyYMax, Mode=OneWayToSource, ValidatesOnExceptions=True, FallbackValue=1.1}" ...
03-03-2015 12:23 AM
I didn't think of that 😞 That solves it! Thank you!