An Example of Asynchronous Input Validation

The downloadable sample code contains a number of examples of asynchronous input validation. The simplest is located in the AsyncValidationViewModel class.

The AsyncValidationView contains two string properties that are required to be non-null or whitespace strings (see Figure 26.12).

Image

FIGURE 26.12 AsyncValidationView page.

When either of the two properties is set to an empty or whitespace string, a data validation error is created for that property. This validation occurs when the user modifies the text or when the Submit button is tapped (see Figure 26.13).

FIGURE 26.13 The Validated String 1 form ...

Get Windows® Phone 8 Unleashed 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.