O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

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

Input Validation Using Property Setters

The first validation system discussed in this chapter is the property setter validation system. This system has been with the phone since the first 7.0 release of the Windows Phone SDK and is part of Silverlight 3.

The XAML data-binding system provides validation support when assigning a value to the source of a data-binding expression. For example, when a FrameworkElement (the binding target) has a binding to a property in a viewmodel (the binding source) and the value in the FrameworkElement changes, validation occurs as the value is being assigned to the property in the viewmodel.

To enable property setter validation for an input control, set the binding’s NotifyOnValidationError and ValidatesOnExceptions ...

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