4

Advanced User Interface Techniques: Styles, Templates, and the Visual State Manager

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • Customizing controls with styles
  • Understanding how Silverlight controls work by modifying control templates
  • Creating rich control animations with the Visual State Manager
  • Creating your own powerful custom controls for your Windows Phone 7 applications

It's time to take a more in-depth look at some powerful features of Silverlight that you can use to get even more control over how controls look and behave. By the end of this chapter, you should have a solid understanding of how the controls work behind the scenes, and you should be armed with enough information to customize the standard Silverlight controls.

You've seen that all Silverlight controls have some basic attributes and properties that control things such as background and foreground colors. Now you'll see how to set up control styles that you can apply to multiple instances of controls to drastically reduce the amount of XAML code required. Then you'll see how to use the control templates to make changes to the behavior of some of the standard controls. In many cases, this is an easier process than writing a custom control from scratch.

Next up is coverage of the Visual State Manager. This feature of Silverlight makes it simple to perform complex animations and change the way different control states act. For example, if you want to change the color of a Button control when the user presses it, ...

Get Beginning Windows® Phone 7 Application Development: Building Windows® Phone Applications Using Silverlight® and XNA® 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.