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. (Chapter 5 covered content and alignment, while Chapter 6 explored the subtleties of focus and tab order.) The following sections cover brushes and ...

Get Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.