Chapter 6. Styling and Skinning Controls

In This Chapter

  • Changing the look of controls using styling

  • Applying styles in Expression Blend

  • Skinning the controls using templates

  • Using themes to change the look of your application

An important aspect of providing a good experience for users of a Web site is presenting an appealing, professional-looking interface. A key to achieving this kind of presentation is consistency. By consistency, we mean using the same font and color schemes, setting the same margins, and so on throughout the application. To achieve consistency, you can painstakingly set the properties on every individual control, but that's not the best way to do it. What happens if you decide to change something like the font style? You're faced with the tedious, time-consuming chore of changing that property for every control you've used in your application.

This is where the styling and skinning features in Expression Blend come to your rescue. In this chapter, we show you how to create styles and templates (which is another name for skins) as well as how to apply them to your controls.

Applying Styles to Controls

You can change the way a control looks by setting its various properties. Some of the typical properties on a TextBlock that you may set include:

  • VerticalAlignment and HorizontalAlignment

  • FontFamily, FontSize, and FontWeight

  • Margin

  • TextAlignment and LineHeight

You can set these items quite easily by selecting multiple TextBlocks simultaneously using the Selection tool and ...

Get Silverlight™ 4 For Dummies® 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.