Chapter 18. Input validation

 

This chapter covers
  • Validating properties in code using exceptions
  • Using IDataErrorInfo and INotifyDataErrorInfo for validation
  • Controlling DataGrid and DataForm validation through attributes

 

The previous two chapters covered the binding system and some of its important uses within Silverlight. The binding system is also so important because of the input validation approaches in Silverlight built directly on it.

Validation is something almost every nontrivial application with a TextBox will need to do at some point. Often, you punt and do simple checking in the code-behind. But if you want to truly leverage binding, take advantage of patterns such as the ViewModel pattern, and have better structure to your ...

Get Silverlight 5 in Action 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.