Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 15: Control Templates

C H A P T E R  15

Control Templates

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial