O'Reilly logo

Mastering Windows Presentation Foundation by Sheridan Yuen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. 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 had the correct number of digits in, 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required