O'Reilly logo

Silverlight™ 4 For Dummies® by Mahesh Krishnan, Phillip Beadle

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required