Learn how to use Windows Presentation Foundation to build engaging, dynamic user interfaces that can really grab the user's attention.
by Rod Stephens
Jan 9, 2009
Page 5 of 5
Now that you've seen some of WPF's capabilities, here's a summary of how they provide WPF with some true advantages over Windows Forms:
Property animations can add a little extra zing to an application.
Transformations let you move, scale, and rotate elements, making it much easier to build unusual types of interface content, such as vertical or angled labels.
Multimedia controls make it easier than ever to include audio and video in your applications.
WPF makes building and manipulating three-dimensional UI objects easier than it is using Direct3D directly.
Retained-mode graphics make updating and modifying complicated graphics easier.
Control content can include just about anything, making it much easier to build new combinations such as a Button that contains a Grid that holds other controls.
New controls give you new layout options.
The new FlowDocument control lets you build complicated documents containing text, shapes, images, and even WPF controls.
Styles and templates let you change the appearance, structure, and behavior of controls in a centralized way.
Finally, WPF does have a few disadvantages, the biggest of which is its complexity. Some of WPF's features are complicated and confusing. Terms and behaviors are sometimes contradictory, with similar code producing different results under different circumstances. The current tools (VS and Expression Blend) are imperfect and provide limited IntelliSense support. (Okay, I admit I'm spoiled by the excellent IntelliSense I get when writing Visual Basic or C# code.) In other words, to really learn WPF you need to overcome a steep learning curve. Finally, there's cost. The best development environment combines VS (the Express Edition is free) and Expression Blend (which most definitely is not free). You can build WPF applications using only VS, but Blend makes animations a lot easier.
Fortunately, you don't have to use all the new features to use WPF. If you're experienced at Windows Forms programming, you can throw the new WPF controls on a Window, add event handlers in the code-behind, and work pretty much as you always have, ignoring property animation, transformations, and three-dimensional graphics. You can add the new tools that you may need now (such as easier multimedia support) and pick up the others if and when you need them.
In later articles, I'll describe specific pieces of WPF in greater depth. Until then, set up WPF on your computer and start experimenting with the example programs.
WPF is an interesting technology. If you don't get carried away with animations, multimedia, and other frippery, you can use it to build user interfaces that are truly works of art.
Rod Stephens is a consultant and author who has written more than a dozen books and two hundred magazine articles, mostly about Visual Basic. During his career he has worked on an eclectic assortment of applications for repair dispatch, fuel tax tracking, professional football training, wastewater treatment, geographic mapping, and ticket sales. His VB Helper web site receives more than 7 million hits per month and provides three newsletters and thousands of tips, tricks, and examples for Visual Basic programmers.