JOEHEWITT.COM

Thoughts on software and life.

Monday October 27

XAML thoughts, part 1

Microsoft has finally posted the Longhorn SDK on MSDN. This includes coverage of XAML, a broad new UI markup language that has all of the capabilities of Mozilla's own XUL and XBL, plus HTML, CSS, SVG, SMIL, and more. I am anxious to dig in and distill exactly what can be done with XAML, how it relates to existing languages, and what new capabilities it gives us.

My initial impressions...

XAML has equivalent tags for the HTML block/inline layout model (albeit, with much wordier tag names like Paragraph, HyperLink, and LineBreak). However, they also allow us to do multi-column layout, which is one of those no-brainer features that the W3C just dropped on the floor.

There are equivalent tags for doing tables, but importantly there is a separate set of tags for doing grids, which make for a much easier way of expressing a simple table-like layout. I like these tags better than XUL's grid tags, because you don't have to wrap each row in another element, you just provide a list and tell it how may columns to split.

XAML's "style system" confused me at first, because it bears little resemblance to CSS. Turns out, their style system is really a combination of CSS with Mozilla's XBL, all expressed in XML. A "Style" tag appears to contain an instance of an element such as a button, but in fact this is really a style rule whose tag is like a CSS tag selector, and whose name is like a a CSS class selector. Styles can be forked based on property values, using "PropertyTrigger" tags, which are basically like CSS attribute and pseudoclass selectors. Confusingly, I also found a brief description of something called property sheets, which looks more like the CSS we know and love, but different. There isn't any real documentation on this yet.

The style system also has a feature that is very similar to Mozilla's XBL or IE Behaviors. It allows you to define a block of content called the "VisualTree", which is like XBL "anonymous content", allowing you to embed arbitrary content (images, text, buttons) within an element. However, the cool thing is that the "VisualTree" is part of a style rule, which means that it can be cascaded as if it were just another CSS property.

at
Posting your comment. Please Wait...