Validation

When the Silverlight data-binding system encounters invalid data, it usually ignores it. For example, consider the following list, which details the three types of errors that can occur when you're editing a two-way field:

  • Incorrect data type: For example, a numeric property like UnitCost can't accommodate letters or special characters. Similarly, it can't hold extremely large numbers (numbers larger than 1.79769313486231570E+308).
  • Property setter exception: For example, a property like UnitCost may use a range check and throw an exception if you attempt to set a negative number.
  • Read-only property: This can't be set at all.

If you run into these errors, you're likely to miss them, because the Silverlight data-binding system doesn't ...

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