Chapter 13. Custom controls
This chapter covers:
- Creating user controls
- Creating custom controls
- Changing the template on custom controls
- Making a hyperlink happy and then sad
With Windows Forms, MFC, or even straight SDK programming, you often ended up building custom controls to create a particular look-and-feel or type of behavior that the built-in controls didn’t provide. More often, though, you ended up not building custom controls, and making do with built-in behavior because building those controls was a royal pain. Building controls was generally all or nothing—either you used all the built-in handling or you built everything from scratch for your control.
WPF changes all that. First, you don’t even need to bother building custom controls for most things because the system is so flexible—you can customize the look-and-feel of virtually every aspect of every control, as well as easily changing much of the behavior. Second, if you do need to do something special, you can often do it by combining existing elements (compositing) to get the behavior that you want.