concept exception in category silverlight

appears as: exceptions, exception, n exception, The exception
Silverlight 4 in Action: Silverlight 4, MVVM, and WCF RIA Services

This is an excerpt from Manning's book Silverlight 4 in Action: Silverlight 4, MVVM, and WCF RIA Services.

Validation, covered in chapter 13, was one of the biggest new features for business applications. Silverlight didn’t add just validation but included support for validation through attributes, validation through exceptions, and even asynchronous validation, all of which work with the Silverlight controls. Silverlight even made it possible to completely customize the style of the validation information provided to the end-user.

Silverlight provides several ways to validate data. The simplest and oldest approach is to use exception-based validation. In that approach, property setters simply throw exceptions when the validation doesn’t pass. This is the code equivalent of my toddler’s spitting out the food she doesn’t like and, like that, anything more complex than a couple of peas is going to get pretty messy.

13.3.4. Combining exceptions and IDataErrorInfo

When we turned on ValidatesOnDataErrors, we removed the ValidatesOnExceptions parameter. That’s used not just by our own code but also by the built-in type checking. For example, when you try to assign a string like "dfdf" to an int, you’ll get an exception. That exception bubbles up and, if not handled by the binding system, it just disappears.