Skip to Main Content
Windows Presentation Foundation 4.5 Cookbook
book

Windows Presentation Foundation 4.5 Cookbook

by Pavel Yosifovich
September 2012
Intermediate to advanced content levelIntermediate to advanced
464 pages
10h 55m
English
Packt Publishing
Content preview from Windows Presentation Foundation 4.5 Cookbook

Validating data

Data binding provides automatic updates from a source to a target (and vice versa in a two way binding). Some of these values are provided by some user of the system; consequently, not all values are valid. The binding system should have ways to catch such errors and allow the application to communicate to the user those errors. This is the role of data validation. In this recipe, we'll look at the validation support in data binding scenarios.

Getting ready

Make sure Visual Studio is up and running.

How to do it...

We'll create a simple entry form that validates its inputs according to some application-specific rules.

  1. Create a new WPF application named CH06.ValidatingData.
  2. Add a new class to be used as a data object named Person. Implement ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows Presentation Foundation Development Cookbook

Windows Presentation Foundation Development Cookbook

Kunal Chowdhury

Publisher Resources

ISBN: 9781849686228Supplemental Content