Share via


Styling objects

You can style the objects in your application in different ways. The most basic way is to set properties that relate to the appearance of the object.

For more information, see Setting colors, brushes, and masks.

You can also apply effects to objects, such as drop shadow effects or blur effects.

For more information, see Applying effects.

If you want to style a control that supports templates, such as the Button control or the ListBox control, you can modify its template. You can either start with a copy of the default template and modify that, or focus on your design by drawing everything on the artboard first, using drawing tools, and importing art or other assets. When you are done, you can convert your objects into a template for any control. Because the template affects only the appearance of the control to which it's applied, the interactivity of the control remains the same.

For more information, see the following:

As an alternative to using a control, you can create your own user control, and define a different visual appearance for each state the control can be in.

For more information, see the following:

Styles and templates are stored in reusable entities called resources. In fact, the value of any property can be converted to a reusable resource that you can apply to another property.

For more information, see Creating reusable resources.

Multiple resources can be stored in a resource dictionary file and then added to multiple projects. By doing this, you can define a theme for your company by storing color resources, and styles and templates for common controls, in a resource dictionary.

If you want to style a media player that you can use in Microsoft Expression Encoder to encode video, you can style it in Blend for Visual Studio 2012.

For more information, see Customize an Expression Encoder template for Silverlight.

See Also

Tasks

Try it: Make a nonrectangular window

Concepts

Writing code that will respond to events