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

  • Live Event Date: November 20, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Are you wanting to target two or more platforms such as iOS, Android, and/or Windows? You are not alone. 90% of enterprises today are targeting two or more platforms. Attend this eSeminar to discover how mobile app developers can rely on one IDE to create applications across platforms and approaches (web, native, and/or hybrid), saving time, money, and effort and introducing apps to market faster. You'll learn the trade-offs for gaining long …

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds