O'Reilly logo

Applied WPF 4 in Context by Raffaele Garofalo

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

The XAML Syntax

The XAML language is a complex and very flexible markup language applied to different technologies by using different references in the XAML file so that you can refer to different objects that provide different XAML elements and attributes.

Like any other XML file, a XAML file must have a valid structure and must follow some specific rules; one of these rules is the presence of a valid root element.

Namespaces and Root Elements

In XAML you define a root element as the root of your XAML document; this is a mandatory requirement for the XAML file and for the XML validation. In a WPF context, the root element of a XAML file will be a Page, UserControl, or Window if you are creating a UI container or a simple ResourceDictionary

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