Windows Presentation Foundation (hereafter referred to as WPF) is a new API for creating graphical user interfaces for the Windows platform. It is an alternative to WinForms that further empowers developers by providing an API capable of taking full advantage of the multimedia facilities of the modern PC. Unlike WinForms, it does not wrap Win32 but is completely new, built from the ground up using .NET. The fundamental power of WPF comes from the fact that it is vector based, hardware accelerated and resolution independent.
Reminiscent of WinForms, you’ll find many of the controls you are used to when building applications: Button, ComboBox, ListBox, etc. However, in WPF, your UI design is represented in a completely different fashion. Instead of using a designer generated code file or a resource file as the source of a UI definition, WPF uses xml. Specifically, it uses Xaml (more on this in the next post). Please, don’t let this frighten or dissuade you. It’s surprisingly intuitive and much easier than you would think (not to mention fun). There are many other new features in WPF, too many to discuss in a “Crash Course.” Below, you can see a chart depicting what I consider to be some of the most important features/innovations in WPF.
The right column of the chart lists some technologies that you may be familiar with that parallel the ideas in WPF. Hopefully this gives you a starting point for understanding the terms on the left. Don’t take the parallels too literally; there are differences. We’ll talk about each of these areas in future posts and I’ll provide additional resources for going into greater depth as well.
Besides the above mentioned features there is a new type of application. The standard windows application is alive and kicking, but you now have an additional option: the Xaml Browser Application. When you deploy this type of application to a web server, users can navigate to a URL and run your program from within the IE7 sandbox. The experience is similar to using a Flash app, but is restricted to users of IE7. You can begin to imagine the types of rich intranet applications you could build for a company if you were given IE7 and .NET 3.0 as the platform. At the same time, it’s too bad that it only works in IE7. Don’t lose heart yet! Microsoft is currently working on Windows Presentation Foundation Everywhere (WPF/E), a cross-platform, cross-browser subset of the .NET Framework and WPF!!! Check this out for an early demo of WPF/E running in the Safari browser on Mac OSX.
I should mention a few general items available for learning and working with WPF. If you have installed the VS extensions for .NET 3.0, then you now have the “Orcas” designer available to you. This is a tool much like the WinForms designer, but it is obviously for creating WPF UIs. It has a tabbed design, so that you can switch back and forth between the visual designer and markup. The powerhouse design tool is Expression Interactive Designer, which you can get here. If you are more graphically inclined, you are going to want to check this out. It is similar to using a tool like Adobe Illustrator, but it generates Xaml and integrates with the VS solution and MSBuild. This is a landmark tool because it makes designers fully fledged members of the development team. No longer do they need to do a UI mockup and deliver it to a developer to implement (or turn down because of its complexity). They can simply build the UI using a set of tools that they are familiar with. A similar third party tool is Mobiform’s Aurora. The beta is free and I highly recommend investigating it. There are also numerous plug-ins for exporting 2D/3D art to Xaml from most popular programs. If you can’t find a plug-in, then perhaps you want to write one and enter it in this contest. Regardless of whether you are approaching WPF from a developer or designer’s perspective, you are probably going to want a good book on the technology. Currently, the best resource I know of is Charles Petzold’s book: Applications = Code + Markup. I have read the first half of this book and it is quite thorough.
NEXT POST: Down & Dirty With Xaml
09-25-2006 3:22 PM