Incorporating Group Validation
In the previous example, you saw how the ViewModelBase.IsComplete
method is used to trigger validation of a viewmodel. This section looks at extending the validation to set control-enabled states based on the presence of validation errors and at hiding validation errors until the user has had a chance to fill out the form.
Before proceeding, you may want to briefly review the section “Performing Group Validation” earlier in the chapter, and in particular Figure 26.7.
The SendEmailViewModel
in the downloadable sample code is a more complex example of asynchronous input validation. In it, the sendEmailCommand
is prevented from executing if it is already in execution or if the form is invalid.
When SendEmailView
is ...
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.