SUMMARY

In this chapter, you learned more about the Silverlight runtime and customization of controls. First, you learned how to alter the look and feel of most of the standard Silverlight controls by modifying the various styles of controls. Control styling encourages code reuse by allowing you to set up styles that can be shared across similar controls. With BasedOn styling techniques, you can even create a base style for when controls need to share a basic set of styled properties such as Margin, Padding, Background, and Foreground. Next, you saw how to further alter the default look of controls by making use of custom control templates.

Also in this chapter, you learned how to use the Visual State Manager in order to provide smooth animations and a variety of control states for custom controls. The Visual State Manager provides an easy way to perform timed animations across several controls. It also makes it easy to change the style of various control states, such as the Button control's Pressed and Disabled states. You even saw how to create your own custom states, when necessary, for your own controls.

Finally, for times when the default Silverlight controls don't provide all the functionality you're looking for, you saw how to make use of custom user controls and custom controls. The custom user controls provide a nice way to reuse existing XAML across multiple pages in a Windows Phone 7 application. Custom controls take everything a step further and allow for ultimate flexibility ...

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.