Question

I'm using the Extended WPF ToolKit's DecimalUpDown control (v1.7). The control behaves as I expect when using the spinner controls but not when text is edited directly. This is a basic MVVM WPF app with the control bound to a View Model decimal property named CurrentWidth.

In the ViewModel there are various validation rules being enforced for CurrentWidth, at the end of the property it does a RaisePropertyChange("CurrentWidth"); sometimes leaving CurrentWidth unchanged if the value doesn't validate.

All the error checking, value reverting etc works when change is made with the spinner controls. When the user enters text directly in the box, the validation still works but the box is left showing what the user entered. When I send out some debug info, both the Value property and Text properties have the correct unmodified value but the box still shows the user entered value. I tried adding a LostFocus event handler and called InvalidateVisual() on the sender control and even tried an UpdateLayout() as well but after tabbing off the control, the user entered text still shows. Anyone know how to get it to reflect the actual current value?

Was it helpful?

Solution

Download WPFToolkit 1.8.0. This bug is solved there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top