Page 1 of 1

Bind textbox to float value. Unable to input dot

Posted: 31 Aug 2021, 15:16
by Gosha
Hello!
I am facing an issue where the user cannot enter "." in a textbox bound to a floating point value while the UpdateSourceTrigger has a PropertyChanged value.
Of the possible solutions that I have found, there is a use of
 StringFormat=N2
, but I can't because of design considerations.
And solutions such as adding a delay or adding a custom converter look like a hack.

I found a solution which is to force use .NET 4 behavior:
System.Windows.FrameworkCompatibilityPreferences.KeepTextBoxDisplaySynchronizedWithTextProperty = false;  
Can I do something like this in noesis with c++?

I also read about the solution with writing my own validator. Is this supported?

Re: Bind textbox to float value. Unable to input dot

Posted: 31 Aug 2021, 21:51
by sfernandez
System.Windows.FrameworkCompatibilityPreferences.KeepTextBoxDisplaySynchronizedWithTextProperty = false;
Can I do something like this in noesis with c++?

I also read about the solution with writing my own validator. Is this supported?
None of those approaches are supported by Noesis.

The best option is using a Converter so you can decide how to deal with a leading or trailing dot.