With the behavior, I like and expect a “positive” script / workflow without errors. There are no errors in focus. The user gets pretty quickly that when they type ' a ' into a TextBox with a Numeric behavior that they don’t accept, it is a numeric text field, and so it works.
When checking, the focus seems to be more related to the error. I can have a numeric text box, but I also do not accept numbers outside 100, if you type " 101 ", I will let you know that this is unacceptable. The focus here is on how the user enters an invalid value, causing a validation error.
The benefits of behavior:
- Prevention (you do not allow the user to shoot himself in the leg) by entering bad data.
- The model remains clean. TextBox Binding does not even get into the setter, since the behavior prevents it, therefore, XAML does not start using PropertChanges or ValidationErrors, etc.
Behavior Disadvantage:
- it can be confusing, therefore, if you put the logic so that it does not accept "101", by default the user cannot use the default method.
source share