Chapter 4. XAML

A Tree of Objects

One of the most important concepts of WPF is that the user interface is a tree of WPF class objects. That tree has a single node at the top, and each node in the tree can have zero or more child nodes.

In Chapter 2, you saw that you can use C# to instantiate WPF class objects and connect them explicitly, creating the tree.

But the tree structure is exactly the type of structure produced by an XML document. The WPF designers used that fact to create a variant of XML, called XAML, for creating trees of WPF objects. (XAML stands for eXtensible Application Markup Language.) A XAML parser interprets the XAML markup and produces the tree of WPF objects, as illustrated in Figure 4-1.

Figure 4.1. The XAML parser interprets ...

Get Illustrated WPF now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.