Skip to content

Invalid Value does not fire on lost focus or property changed #68

@dev11ocean

Description

@dev11ocean

When the user enters in their own number, if it is invalid, the property changed event does not fire nor does the lost focus event if that is used instead. The underlying value is not changed either, but the invalid number is still displayed in the updown control. Is there a way to revert to the last good number?

For example, say I have the following:

<numericupdownlib:DoubleUpDown
    MinValue="0"
    Value="{Binding TestValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

The user can type in a value below 0 like so:
image

However, the underlying value remains at 0.
No propertychanged event is fired, and no lost focus event when focusing a different control. The invalid value stays in the box until the user changes it to something valid, presses the up button, or changes the value in the code behind. It feels like a disconnect because what the user sees and what the underlying value is is different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions