News Stay informed about the latest enterprise technology news and product updates.

Microsoft's Avalon presentation API is coming

Whether you know it by its hip codename or as the Windows Presentation Foundation, it is the future of user interface design for those of us in Windows development.

Avalon is coming. Well, actually, Windows Presentation Foundation is coming. But whether you know it under the hip codename it's been using for a couple of years now, or the newly-sanitized corporate moniker it goes by in the Windows Vista beta, the essential message is the same: This is the future of user interface design for those of us in Windows development. As such, it's worth knowing a bit about what's coming, even if it won't matter to most of us for a couple of years.

Let's start with the basic facts: WPF consists of a new graphics runtime that runs on top of DirectX, and that is meant to be called from everywhere (browser-based applications, Windows forms, video, documents, you name it), plus a framework (what we used to call APIs before the term "framework" became so sexy). WPF will ship as a native part of Windows Vista (if you haven't been paying attention, that's the operating system that used to be called Longhorn) some time in 2006, and will be available as an add-on to Windows XP and Windows 2003. Microsoft still nurses fond hopes that people will throw away all older versions of Windows.

Another piece of the puzzle is XAML, the extensible application markup language. XAML provides a new way to define the user interface of Windows applications, by writing XML markup instead of code. Just to give you the idea, here's a tiny piece of XAML markup from a calculator sample application:

<ControlTemplate TargetType="{x:Type Button}">
<Rectangle x:Name="GelBackground" Opacity="1" RadiusX="10" RadiusY="10"
Fill="{TemplateBinding Background}" Stroke="VerticalGradient #cccccc white "
StrokeThickness="1" />
<Rectangle x:Name="GelShine" RadiusX="6" RadiusY="6" Margin="3" Opacity="1"
Fill="VerticalGradient #ccffffff transparent" Stroke="transparent" />
<Viewbox ClipToBounds="True" Stretch="Uniform" VerticalAlignment="Center"
HorizontalAlignment="Center" Margin="15">
<ContentPresenter HorizontalAlignment="Center" ClipToBounds="True"
x:Name="GelButtonContentShadow" Content="{TemplateBinding Content}"
TextBlock.Foreground="#dd000000" RenderTransform="translate 0.5 0.5"
TextBlock.FontSize="10pt" />
<ContentPresenter HorizontalAlignment="Center" ClipToBounds="True" x:Name="GelButtonContent"
Content="{TemplateBinding Content}" TextBlock.Foreground="white"
TextBlock.FontSize="10pt" />

I'm not going to explain that tag soup, because by the time WPF ships there will be tools to write it all for you; you'll work in visual designers, just as you do now. (If you want to know more about the plumbing, start with the Windows Vista Developer Center).

But there are two important points to grasp. The first is that user interface definition is being separated from the code that controls user interface behavior; it will be much easier than it is now to have a designer work on the UI while a developer works on the guts of an application. The second thing to realize is that Microsoft is building everything including the kitchen sink into WPF. If you've seen screenshots of Vista, you know that there are lots of rounded corners and highlights and translucent doo-dads. There are also provisions here for video and speech and rotating things and three-dimensional scaling and alpha blending and you name it. Microsoft is apparently determined to not let Apple have all the user interface fun this time around.

This leads to a plea that I would like to make early and often to VB developers (and other developers, for that matter) who are planning to move forward to this brave new world of the next-generation Windows user interface: Restrain yourselves!

I say this because I've already seen some truly horrible examples of what can be done when developers have the ability to stick a 3D fly-through rotating semi-transparent interface on top of a file- listing window. It isn't pretty. Or usable.

Remember what I said about the new model enabling developers and designers to work together? The smart developers are going to take advantage of this to produce stunning applications that fit the new user interface guidelines. The cocky ones will go it alone and turn out hideous junk that makes us all want to stick forks into our eyes. Please don't fall into the latter group.

Mike Gunderloy is an independent developer and author working in eastern Washington state. His recent books include Painless Project Management with FogBugz (Apress) and Coder to Developer (Sybex). You can read more of Mike's work at his Larkware Web site, or contact him at

Dig Deeper on Windows Presentation Foundation

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.