Error templates

As we have discussed previously, we can notify the user of the error condition by highlighting the particular field that failed the validation in the view. By default, the element is highlighted with a red border. We can update this behavior by overriding the error template. Let's revisit the example in the previous chapter to demonstrate error templates. In that example, we had a simple order entry form where the user could submit an order by specifying a customer, a product, and its quantity. Let's now update OrderViewModel, as follows:

namespace MVVMApp_WFBasedBusinessRules.ViewModel { using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Command; using MVVMApp_WFBasedBusinessRules.Model; class OrderViewModel : ViewModelBase { ...

Get MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF now with O’Reilly online learning.

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