Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In the last chapter you started to get your teeth into some real WPF programming projects using XAML and VB. Using XAML to define an application’s interface declarative certainly sets WPF programming apart from older, code-only platforms. But as cool as declarative programming is, it’s perfectly possible to ignore XAML completely and write a WPF application completely in VB.
The same isn’t true of the subject of this chapter: dependency properties. Take a look at the WPF class hierarchy from the last chapter. Every WPF class descends from DependencyObject; in a sense that’s what makes a class part of WPF. And what does DependencyObject do? It implements the dependency property system.
Unlike standard .NET properties that only change their values when a new value is explicitly assigned to them, dependency properties can inherit their values from their parents in the logical tree, change their values over time, and notify their world when their values change. A dependency property definition can even be shared across multiple classes. (The attached properties like Grid.Row that you’ve been using are a special kind of dependency property.)