Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In the previous chapter, you learned how to use styles and behaviors to reuse user-interface property settings and code. In this chapter, you'll explore two more powerful tools: control templates and custom controls.
Templates allow you to change the visual “face” of any common control. In other words, if you can't get the custom appearance you want by tweaking properties alone (and often you can't), you can almost certainly get it by applying a new template. And although creating custom templates is more work than just setting control properties, it's still far simpler and more flexible than developing an entirely new custom control. Furthermore, if the control that you're customizing supports the parts and states model (and most do), you can place custom animations in your template—for example, to change the way a button glows when it's hovered over or to set the animation that slides a new item into place when it's added to a layout control.