The popularity of declarative markup languages has gradually increased
since the initial release of HTML. This shouldn't come as a surprise to
anyone given that markup languages let information be presented to end
users without requiring any knowledge of a programming language. For
years HTML has served as the declarative language of choice for presenting
information to end users through a browser and it certainly isn't going
anywhere in the near future. However, new declarative languages such as
Extensible Application Markup Language (XAML) have emerged, providing an
alternate means for displaying data in more rich and engaging ways than
HTML is capable of doing. In this article, I introduce the XAML language
and describe several ways it can be used in Silverlight applications.
The topics covered will focus on functionality available in Silverlight
1.0. Future articles will introduce new XAML features available in
Silverlight 2.0. XAML was originally created for the Windows Presentation
Foundation (WPF) technology released with .NET 3.0. WPF and XAML provide
a way to integrate designers into the application development process
and create rich and interactive desktop (and even Web) applications that
can bind to a variety of data sources. The release of Silverlight 1.0
brought XAML to the world of rich internet application development.
Silverlight exposes a subset of the XAML language found in WPF that can
be run directly in the browser once the Silverlight plug-in has been
installed... Although Silverlight provides a subset of the XAML language
available in WPF, the different declarative elements and attributes
available can accomplish a lot and provide functionality that simply
isn't available in the HTML language. For example, different types of
shapes such as rectangles, ellipses, and lines can be defined and
displayed using XAML. Different types of backgrounds can be defined for
shapes as well including gradients, images, and media clips... Learning
XAML is much like learning HTML; you have to learn the different tag
names and understand how tags can be nested within parent containers.
Once you know the available elements and attributes it's relatively easy
to create a XAML file.