XAML FEATURES

XAML is a form of XML that defines certain allowed combinations of XML elements. For example, a XAML file should have a single root element that represents a Window. That object can have a single child element that is normally a container. The container can hold several children with specifically defined properties such as Width and Height.

XAML is a very complicated language, and many of its features are available only in certain places within the file. For example, inside a Button element you can place attributes such as Background, BorderThickness, Margin, Width, Height, and Content. The XAML text editor provides IntelliSense that makes figuring out what is allowed in different places easier, but building a XAML file can still be quite challenging.

NOTE
One good way to learn XAML is to go online and search for examples. The Microsoft website has lots of examples, as do several other sites. Although the documentation isn’t always easy to use, the examples can help you learn specific techniques. Some good places to start include the XAML overview at http://msdn2.microsoft.com/ms752059.aspx and the Windows Presentation Foundation development page at http://msdn2.microsoft.com/ms754130.aspx . My book WPF Programmer’s Reference (Wrox, Stephens, 2010, http://www.amazon.com/exec/obidos/ASIN/0470477229/vbhelper ) also provides lots of examples of useful techniques.

The following sections describe some of the basic building blocks of a XAML application. They explain ...

Get Visual Basic 2012 Programmer's Reference 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.