Enter key doesn't work on DoubleEditBox

Editors for WPF Forum

Posted 8 years ago by BLANC Stéphane - Staubli Robotics Suite Product Manager, STAUBLI
Version: 11.2.0552
Avatar
Hello

I have a problem with the DoubleEditBox : the enter key is not validating the input.
I found on this forum that the PartValueCommitTriggers should solve the problem but it's not working for me... ?

<editors:DoubleEditBox 
Value="{Binding Value, ElementName=marker, StringFormat=0.0}"
Minimum="-100.0"
Maximum="+100.0"
SpinnerInactiveVisibility="Hidden" SpinnerVisibility="Hidden"
Focusable="True" Format="F2"
PartValueCommitTriggers="SpinnerChangeOrEnterKeyDown"/>
I will also like to know how to change the default background color when the control has the focus ?

Thanks for your help

Stéphane

Comments (2)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Stéphane,

What do you mean when you say validating the input? The PartValueCommitTriggers control when the various parts (which in the case of DoubleEditBox there is only one) will update the Value property of the associated edit box. What happens after that depends on the binding/event handlers you have hooked up. The Binding you have will not update the marker's Value property until the focus is lost. You would need to add UpdateSourceTrigger=PropertyChanged in order to update it immediately.

If you are using the latest version then you can customize the asset AssetResourceKeys.EditBackgroundFocusedBrushKey, like so:
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.EditBackgroundFocusedBrushKey}" Color="Red" />


Actipro Software Support

Posted 8 years ago by BLANC Stéphane - Staubli Robotics Suite Product Manager, STAUBLI
Avatar
Thank you. The problem came from my binding.
Adding "UpdateSourceTrigger=PropertyChanged" solves the problem

Stéphane
The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.