Implementing Responsive Data Validation

Data validation goes hand in hand with data input forms and is essential to promote clean, usable data. While the UI controls in WPF can automatically validate that entered values match the type of their data bound properties, they cannot validate for the correctness of the entered data.

For example, a TextBox control that is data bound to an integer may highlight an error if a user entered a non-numeric value, but it wouldn't validate that the entered number contained the correct number of digits, or that the first four digits were appropriate for the type of credit card specified.

In order to validate these types of data correctness when using MVVM, we'll need to implement one of the .NET validation ...

Get Mastering Windows Presentation Foundation - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.