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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.