Prev Next |
This article assumes that you are already familiar with the XML markup language. XAML is built up in the same way as any XML document, but instead of describing the data, it describes the UI object model. Each tag corresponds to a managed class and tags attributes are mapped to the class properties. So when you add the <Literal Text=”Hello” /> tag to the page, you are actually instructing runtime to instantiate a new object of Literal type and initialize its ‘Text’ property with ‘Hello’ value.
As in XML, you can also nest tags. A tag always has only one parent, but any number of children (although adding children doesn’t always make sense). When you nest tags in the following way:
<Literal Text="Hello" />
</Border>
you instruct the runtime to create and initialize a Border object and then populate its Controls collection with the new Literal object.
Of course, these are only a few basic concepts. If you want to read more about XAML, please refer to the related links in the Introduction of this article or search for more information on the Internet (for example, via Google) where you can find a great deal of additional information.
Prev Next