Term of the Week: XAML

XAML (Extensible Application Markup Language) is the codename for a new Microsoft markup language used to create UI elements for client applications in the forthcoming Windows release codenamed "Longhorn." The main XAML benefit to developers is that you'll be able to separate the application logic code from presentation code. You could have designers building your application UI as a XAML skin separate from the development of the application logic code. XAML is part of Microsoft's overall "Avalon" presentation programming model in Longhorn, so you'll often see references to Avalon and XAML together.

XAML is XML-based and is implemented as an XML schema, and the schema currently is installed when you install Longhorn as xaml.xsd. It is a declarative language, because XAML programs are based on rules and facts to follow, rather than a list of steps to execute. In most cases, however, a XAML program will combine one of the other .NET languages, primarily either Visual Basic .NET or C# (JScript is supported too), using either code behind or markup within the XAML file. XAML uses these other languages to support events and user interaction.

The XAML language isn't complete or final yet, so any examples you see at this point could possibly change. And, the current XAML schema isn't completely valid according to XML schema rules but Microsoft expects that later iterations will be valid. XAML will be supported as a language in the Visual Studio .NET release codenamed Whidbey, giving developers the tool they need to code in XAML in preparation for the Longhorn OS release, providing VS interface features such as IntelliSense to ease XAML coding.

XAML programs are made up for four basic element categories. The four categories are panels, controls, text formatting, and shapes.

Panels control page layout in the UI. They are also containers for other XAML elements. Controls react to user input. Text formatting elements handle the obvious text formatting issues their name implies, but also handle document structure. And lastly, shapes produce vector graphics.

Elements are represented by tags such as:

<Text>Hello World</Text>

A tag like this with inner text requires an ending tag as shown.

Elements are arranged hierarchically, with one root element. The parent property is used to access higher elements in the hierarchy. An element deeper in the hierarchy is called a child. Element tags can have attributes, similar to the attribute concept you are familiar with in HTML where the attribute modifies the tag behavior. For instance, if you need to specify the size of that "Hello World" text, you might use an attribute such as:

<Text FontSize="20">Hello World</Text>

So, when can you start tinkering with XAML? Unless you are one of a select crowd of developers who have the early Longhorn preview, not immediately. Longhorn was distributed to the few thousand developers who attended Microsoft's Professional Developer's Conference (PDC) in Los Angeles in October, 2003. Additionally, the Longhorn preview is available to developers who subscribe to Microsoft's MSDN Universal service. If you aren't in that crowd, you'll have to wait a while for Microsoft to announce more plans for a more widely distributed Longhorn beta. In fact, over the last few months (late winter 2004), some Microsoft employees have started hinting the Longhorn release will be delayed even further than was expected at PDC, and many public news stories now point to another interim Windows release prior to Longhorn, much delaying the timeframe when you'll be able to put XAML into action.

If you can't wait for Longhorn to get XAML's separation of code and content, you might want to take a look at Xamlon, a XAML-like set of libraries that works with the current .NET Framework.

For Longhorn and XAML technical details, code samples, and more, a great place to start is the MSDN Longhorn Developer Center.

Jim Minatel is a freelance writer for Developer.com in addition to working with Wiley and WROX publishing.



About the Author

Jim Minatel

Jim Minatel is a freelance technology writer and editor with Wiley and Wrox, working primarily on ASP.NET, XML, JavaScript, and SQL for Wiley and Wrox.

Comments

  • MyXaml and VG.net

    Posted by frankhil on 05/28/2004 09:05pm

    I recommend looking at MyXaml, which seems to have more features than Xamlon: http://www.myxaml.com Also there is VG.net, a vector graphics system with a designer integrated in Visual Studio .NET. It is also integrated in MyXaml: http://www.vgdotnet.com

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Today's agile organizations pose operations teams with a tremendous challenge: to deploy new releases to production immediately after development and testing is completed. To ensure that applications are deployed successfully, an automatic and transparent process is required. We refer to this process as Zero Touch Deployment™. This white paper reviews two approaches to Zero Touch Deployment--a script-based solution and a release automation platform. The article discusses how each can solve the key …

  • On-demand Event Event Date: December 18, 2014 The Internet of Things (IoT) incorporates physical devices into business processes using predictive analytics. While it relies heavily on existing Internet technologies, it differs by including physical devices, specialized protocols, physical analytics, and a unique partner network. To capture the real business value of IoT, the industry must move beyond customized projects to general patterns and platforms. Check out this webcast and join industry experts as …

Most Popular Programming Stories

More for Developers

RSS Feeds