Performing Group Validation

Validating a series of input fields usually entails validating each field as the user leaves the field, and then checking for completeness and validity of all fields when the Submit button is tapped (see Figure 26.7).

Image

FIGURE 26.7 Form validation activity diagram.

The UpdateSource method of the BindingExpression class can be used to validate all controls on a form. As you saw in the preceding section, the UpdateSource method causes the target value to be reassigned to its source property. In other words, the value in the control is pushed to its data context, allowing the discovery of any input validation errors.

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.