O'Reilly logo

Microsoft Silverlight 4 Business Application Development Beginner's Guide by Frank LaVigne, Cameron Albert

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

Time for action - validating data input

We will make use of some additional properties of Binding to allow the controls to display the validation states. Blend does not provide a visual way for us to add these additional properties so we have to do it manually in XAML.

  1. Switch to the XAML view of the MainPage.xaml in Blend and scroll down to where our textbox controls are located.
  2. Within the Binding Expression (between the { and } of the Binding), add the following two attributes to each one of the bindings on our input controls:
    {Binding CustomerName, Mode=TwoWay, UpdateSourceTrigger=Explicit, NotifyOnValidationError=True, ValidatesOnExceptions=True }
    
  3. The NotifyOnValidationError and ValidatesOnException will both cause the control to display an ...

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