Prev | Current Page 108 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"

BAML is tokenized, which
means lengthier bits of XAML are replaced with shorter tokens. Not only is BAML significantly
smaller, it??™s also optimized in a way that makes it faster to parse at runtime.
Most developers won??™t worry about the conversion of XAML to BAML because the compiler
performs it behind the scenes. However, it is possible to use XAML without compiling it
CHAPTER 2 n XAML 26
first. This might make sense in scenarios that require some of the user interface to be supplied
just in time (for example, pulled out of a database as a block of XAML tags). You??™ll see how this
works later in this chapter, in the section ???Loading and Compiling XAML.???
XAML Basics
The XAML standard is quite straightforward once you understand a few ground rules:
??? Every element in a XAML document maps to an instance of a .NET class. The name of
the element matches the name of the class exactly. For example, the element