Chapter 23. Resources, styles, and control templates
This chapter covers
- Using application resources
- Control styling
- Building control templates
- The Visual State Manager
Chapter 22 described the powerful animation features available in Silverlight. These features are useful for creating entertaining illustrations and for adding a degree of richness to your application. This richness can also be applied to controls, as you’ll see in this chapter.
Throughout this chapter, you’ll see how to apply rich styles to your application. These styles are similar to the CSS features you may have seen in the HTML world. In general, a Style declaration will be part of a resource, so we’ll cover resources first. From there, you’ll learn how to manage resources in dictionaries before moving on to creating rich visual Styles themselves. We’ll cover both explicit and implicit styles. Then you’ll see how to expand on the definition of a Style to define a ControlTemplate, enabling you to redefine the visual structure of a Control. Once we’ve covered that subject, you’ll learn how to use the VisualStateManager to deliver engaging visual states and transition animations within your Control elements.