FREE BOOK

Chapter 1: Introducing WPF

Posted by Apress Free Book | WPF January 07, 2009
In this chapter you'll peer into the architecture of WPF. You'll get your first look at how itworks, and you'll see what it promises for the next generation of Windows applications.

The Last Word

In this chapter, you took your first look at WPF and the promise it holds. You considered the underlying architecture and briefly considered the core classes.

WPF is the beginning of the future of Windows development. In time, it will become a system like User32 and GDI/GDI+, on top of which more enhancements and higher-level features are added. Eventually, WPF will allow you to design applications that would be impossible (or at least thoroughly impractical) using Windows Forms.

Clearly, WPF introduces many dramatic changes. However, there are five key principles that immediately stand out because they are so different from previous Windows user interface toolkits such as Windows Forms. These principles are the following:

  • Hardware acceleration. All WPF drawing is to take advantage of the latest in modern video cards.
     
  • Resolution independence. WPF is flexible enough to scale up or down to suit your monitor and display preferences, depending on the system DPI setting.
     
  • No fixed control appearance. In traditional Windows development, there's a wide chasm between controls that can be tailored to suit your needs (which are known as ownerdrawn controls) and those that are rendered by the operating system and essentially fixed in appearance. In WPF, everything from a basic Rectangle to a standard Button or more complex Toolbar is drawn using the same rendering engine and completely customizable. For this reason, WPF controls are often called lookless controls-they define the functionality of a control, but they don't have a hard-wired "look."
     
  • Declarative user interfaces. In the next chapter, you'll consider XAML, the markup standard you use to define WPF user interfaces. XAML allows you to build a window without using code. Impressively, XAML doesn't limit you to fixed, unchanging user interfaces. You can use tools such as data binding and triggers to automate basic user interface behavior (such as text boxes that update themselves when you page through a record source, or labels that glow when you hover overtop with the mouse), all without writing a single line of C#.
     
  • Object-based drawing. Even if you plan to work at the lower-level visual layer (rather than the higher-level element layer), you won't work in terms of painting and pixels. Instead, you'll create shape objects and let WPF maintain the display in the most optimized manner possible.

You'll see these principles at work throughout this book. But before you go any further, it's time to learn about a complementary standard. The next chapter introduces XAML, the markup language used to define WPF user interfaces.

Total Pages : 6 23456

comments