C H A P T E R  2

An Introduction to XAML

Extensible Application Markup Language (XAML—pronounced zammel) is an XML-based declarative markup language used to represent a hierarchy of objects.

In Silverlight, XAML is primarily used to define the layout and contents of user interfaces. The use of XAML for defining user interfaces is not a Silverlight-specific concept, however. It actually has its origins in Windows Presentation Foundation (WPF); Silverlight emerged essentially as a subset of WPF designed for use on the Web (hence its early name of WPF/E, or WPF Everywhere, before being christened with the catchier “Silverlight”).

Despite being used to define user interfaces in Silverlight and WPF, this is not XAML's sole purpose. XAML was designed to simply represent a hierarchy of objects, giving it a rather broad scope in which it can be used. Silverlight also uses XAML to define resource dictionaries, animations, and the application root. In fact, XAML has gone on to be used in multiple Microsoft technologies, including Windows Workflow Foundation (WF)—used to define process workflows—and the XML Paper Specification (XPS)—used to define an electronic paper format. In this chapter, we will focus specifically on Silverlight's use of XAML and the XAML extensions that Silverlight implements.

HyperText Markup Language (HTML) is a form of markup language that you are almost certainly familiar with and have possibly used to define user interfaces for web-based applications. HTML was designed as a markup language for structuring documents for display within a web browser but was soon being coerced into doing things it was never designed to do (including formatting documents and positioning document elements to form application user interfaces). Scalable Vector Graphics (SVG) is another markup language that you may be familiar with; it's used to define vector graphics.

XML was designed to provide a standardized yet extensible framework for designing new markup languages that could be used for an almost infinite number of purposes (SVG being one of those languages). XAML builds on this XML framework and takes the capabilities of a markup language much further than ever before—primarily by combining the features found in both the HTML and SVG formats (and much more) into a single powerful markup language definition. As a result, XAML is a powerful, flexible, and extensible means of defining a hierarchy of objects that can serve an array of purposes, and hence these benefits can be harnessed by Silverlight.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.62.105