xxxsey sister - Validating user control

Below you can see the screenshot of the validation rules in action which you tab of the Text Box control without entering any value. We can also easily customize and add new rules by inherting from the Validation Rule class.

validating user control-88validating user control-47

Microsoft WPF team did not put much effort in creating a reliable validation system.

In this article we are going to implement a user control which will validate a Text Box based on custom rules.

In this article we demonstrated how to create a WPF User Control which extends the functionality of a normal Text Box to add validation support.

Using the User Control we can easily add multiple validation rules to our Text Box control.

Our custom window will validate the First Name and the Last Name properties of the Customer object.