For years,
.NET developers have been creating Windows applications with the Windows Forms
toolkit. And though Windows Forms is mature and reasonably full-featured, it’s
hardwired to essential bits of Windows plumbing that haven’t changed much in the
last ten years. As a result, some tasks that should be easy require a lot of
work. For example, if you want to create a modern glow button, it’s up to you to
build a custom control and paint every aspect of your button’s appearance, in
all its different states, using a low-level drawing model. And don’t even think
about adding animated effects like spinning text, shimmering buttons, shrinking
windows, or live previews, because you’ll have to draw every detail by hand.
The Windows Presentation Foundation (WPF) changes all this by introducing a new model with entirely different plumbing. Although WPF includes the standard controls you’re familiar with, it draws every detail itself, using the high-performance DirectX engine. As a result, WPF can provide a whole host of eye-popping new features. For example, you can give common controls like buttons a slick, customized look without writing a line of code. Similarly, you can craft animated effects that rotate, stretch, scale, and skew anything in your user interface right before the user’s eyes. Tasks that would have been difficult or nearly impossible in Windows Forms—like playing media files or creating texture-mapped 3-D shapes—are finally possible.
Although WPF’s video, animation, and 3-D features get the most hype, WPF is just as useful for building business applications that don’t need rich graphics. In fact, WPF enhances key business features like data binding, print management, and document display. It even provides a new model for building browser-hosted applications that can be launched from a website, all without the usual security warnings and irritating installation prompts. In short, WPF combines the best of traditional Windows development with new innovations for building modern, graphically rich user interfaces, making it the hottest new technology to come out of Redmond since .NET 1.0.