XAML (pronounced “Zamel), Object Graph definition language or Extensible Application Markup Language, is Microsoft’s new XML-based declarative markup language for building application in the next generation of Windows, code-named “Longhorn”. XAML allows the developer to control the layout of application interfaces including text, graphics, buttons, and the entire collection of .NET user interface controls.
This looks set to represent the ultimate browser lock-in – in a few years time when IE 7 comes as standard on new PC s I wouldn’t be surprised to see the corporate software development world moving almost exclusively to this technology – after all, it’s going to be extremely easy both to develop and to distribute and it will have all of the benefits of a web application without the downside of the restricted GUIs offered by HTML. With this new layout engine in next IE or in Longhorn Microsoft can kill in same time other browsers and flash.
If XAML lives up to its potential, Microsoft won’t need the W3C any more. Why should they play by the open community’s rules when they can create their own very lucrative and highly controlled gated community?
XAML is a way to create applications in the browser (or out for that matter). For example, imagine a text editor with the rich UI of Windows, but portable in the browser. XAML doesn’t even have to be an application; it could be your existing website in a more structured manner. Sound familiar? Yes it is here already. XAML is basically a copy of Mozilla XUL. I wonder why they didn’t take XUL, well probably to make our life harder and Mozilla life even harder.
Each XAML tag corresponds directly to a .NET Framework class. So creating a new button, for example, is as simple as using a <Button> tag in your XAML file. The tag will then instantiate a Button object using the default constructor then allow you to set properties on the button, such as text label, size, etc.
Events and the associated “code behind” handler are specified in the XAML as attributes as well. In Longhorn, code can be either inline in your XAML file or place in the code behind file, much like ASP.NET.
By using XAML as the presentation layer and your favorite .NET language as the logic and event handling layer, this model allows you to build powerful application that can be easily updated and modified without having to cross the line between presentation and logic. That is, the interface can be completely changed without rewriting your logic and event-handling code.
XAML is a very powerful system, and Longhorn, Microsoft’s next generation Windows, is one of the most exciting things to ever come from Microsoft. XAML has one “catch”?it is currently only part of Avalon, which is the presentation layer of Longhorn. Many capabilities of XAML are tied directly to Longhorn, but on the other hand, many of the concepts could, in theory, be applied to today’s .NET Framework on today’s Windows platforms.