Prev | Current Page 119 | Next

Matthew MacDonald

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

Background>
...


...


CHAPTER 2 n XAML 32
...



...



In the following sections, you??™ll explore the parts of this document??”and learn the syntax
of XAML along the way.
nNote XAML isn??™t limited to the classes that are a part of WPF. You can use XAML to create an instance of
any class that meets a few ground rules. You??™ll learn how to use your own classes with XAML later in this
chapter.
Simple Properties and Type Converters
As you??™ve already seen, the attributes of an element set the properties of the corresponding
object. For example, the text boxes in the eight ball example configure the alignment, margin,
and font:
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
FontFamily="Verdana" FontSize="24" Foreground="Green" ... >
In order for this to work, the System.Windows.Controls.TextBox class must provide the
following properties: VerticalAlignment, HorizontalAlignment, FontFamily, FontSize, and
Foreground. You??™ll learn the specific meaning for each of these properties in the following
chapters.
To make this system work, the XAML parser needs to perform a bit more work than you
might initially realize.


Pages:
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131