Longhorn, Avalon and XAML oh my.

Yesterday I spent all my time at Longhorn presentations....for the most part. I got a chance to look a close look at XAML.

XAML does for smart client windows forms apps what aspx/HTML does to web apps: separates the UI from the rest of your app. In the wake of infopath, I've told more than one person that I didn't think traditional developers would be coding user interface 5 years from now. XAML makes it a lot easier for that to become true.

But XAML is more. Sure you can mark up your form with XML. But it can be compiled into BAML. Binary XAML. You don't have to use XAML to code up your forms, you can still use the current Windows Forms designer than puts your controls into .NET Code in the “Designer Generated Code” region of your form class. Both techniques get compiled and are the performance equivalents. That's cool. You can further compile (or is it link?) BAML into assemblies.

XAML has 2 (or 3) rendering modes. Fixed Format is like windows forms now. Also like Grid Layout in ASP.NET. You scroll around and stretch stuff - but nothing moves. Flow Format is more like traditional flowing HTML. You resize your browser and stuff changes. The rendering agent takes care of paging so the # of pages changes automagically as you resize. You can even click on the scroll bar to get thumbnail views of the next pages in the whole document.

Adaptive Flow is cool. Imagine a 16:9 wide screen and you resize your document to be full screen. It's tough to read a line that long. They've though of everything. When a line becomes too long to read, the rendering engine flips to the display to 2 columns like a newspaper or DTP style document. Makes it so nice and you can see it happen quickly as you resize a form - bam - two columns.

XAML makes skinning pretty easy. In fact in the “Being a good Windows Citizen” presentation, the Windows User Experience team talked about a technique for designing your UI that MS uses and recommends that we all do it. Create 2 or 3 fictional users for your application whose profiles are based on real or anecdotal evidence. Give them names. Give them photos. When you need to make a decision about how your UI should look or the app should work - ask yourself: How would Toby like this screen? How about Jeff? Ms has 8 fictional people that encompasses the full spectrum of their core windows & office products. Skinning your app is sometimes the only way to create a UI that will satisfy everybody - give them each their own. Not only is this possible with XAML, it can be done after the initial compile of your application and you can deploy BAML after initial release much like localized satellite assemblies. Way cool - so long as you design for this from the get go.

Another cool thing about longhorn is that the UI is all vector based. So you can do things like rotate your buttons and text boxes etc. Pretty cool, not very useful. Being able to zoom in on a part of your text though and still have a pretty (not aliased) image is wonderful. It demonstrates the power of the new graphics subsystem and the dependency on graphics cards in Longhorn. It's fast. The new graphics subsystem is rebuilt from the ground up to provide very fast. It needs to. Resolutions are getting bigger and bigger, and being able to scale a traditional UI to make it bigger is important given the predicted growth of screen sizes. It seems like more of a bell or whistle at this point, but it's going to totally change the user experience.

Data binding is now built into the OS. You can bind to files on your WinFs hard drive. A file can have meta data defined by a schema and any of that information is fair game to be bound into your apps. More to come on this. It's just too far out for me to “make it real” at this point. Data binding is one of those things you just have to get into when you need it. But it looks good.

I thought it was kind of goofy that during the key  note, all developer demos  for Longhorn and Avalon were done with Emacs, Slickedit and VIM. Then I realized they had to be. There is no Visual Studio for Avalon yet. You can still get VS.NET any version to edit the class files, but it's no full developer experience for Longhorn/Avalon. There is no WYSIWYG XAML editor yet.

Get ready to design your screens in FrontPage - Ahhhhh!