aisto.com/roeder/dotnet. Using Reflector,
you can see the definitions for dependency properties and routed events, browse through the shared constructor
code that initializes them, and even explore how the properties and events are used in the class
code.
CHAPTER 6 n DEPENDENCY PROPERTIES AND ROUTED EVENTS 181
Classic Controls
Now that you??™ve learned the fundamentals of WPF layout, content, and event handling,
you??™re ready to take a closer look at the elements WPF includes. In this chapter, you??™ll take a
quick tour of the most fundamental WPF controls, including basic ingredients such as labels,
buttons, and text boxes. Although Windows developers have been using these items for years,
this chapter fills in a few important details about their WPF implementations. Along the way,
you??™ll also take a quick look at the System.Windows.Control class to learn how WPF controls
use brushes and fonts.
The Control Class
As you learned in Chapter 5, WPF windows are filled with elements, but only some of these
elements are controls. Controls are user-interactive elements??”elements that can take focus
and receive input from the keyboard or mouse.
All controls derive from the System.Windows.Control class, which adds a bit of basic
infrastructure:
??? The ability to set the alignment of content inside the control
??? The ability to set the tab order
??? Support for painting a background, foreground, and border
??? Support for formatting the size and font of text content
You??™ve already learned about the first two points.
Pages:
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358