O'Reilly logo

MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF by Muhammad Shujaat Siddiqi, Ryan Vice

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 { ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required