Create a reusable template for a system control
You can customize the appearance of system controls by modifying a copy of the control's template.
The following procedure uses a button, but you can create a template for any system control that is included with Microsoft Expression Blend 2 or any imported custom Silverlight 2 control that inherits from the Control class.
To create a copy of the template of a button
Draw a system control on the artboard. For example, select the Button tool from the Toolbox, and then use your mouse to draw it on the artboard.
Use the breadcrumb bar at the top of the artboard to create a copy of the button's template. Click [Button], click Edit Control Parts (Template), and then click Edit a Copy.
Tip
You create a copy because you cannot modify the default template for a system control. Alternatively, you could create an empty template and design your button by importing art assets or drawing new objects.
In the Create Style Resource dialog box, enter a name for the template, such as ButtonStyle1.
Under Define in, select where you want the template to be defined:
To make the template available to a button object in any document in your application, select Application.
To make the template available only to button objects in the current document, select This document.
To make the template available only to this button in this document, select Button from the drop-down box beside This document.
Click OK to exit the dialog box and open the template for editing.
Tip
The breadcrumb bar makes it easy to switch between editing the template that is applied to an object, and editing the object itself. For example, to exit template-editing mode, click [Button] in the breadcrumb bar.
To return to template-editing mode, make sure that the button object is selected (to display the breadcrumb bar for the button), and then click Template in the breadcrumb bar.
Troubleshooting
If you do not see the option to Edit Control Parts (Template) in the breadcrumb bar, you might have selected a control that does not support templates. For example, layout panels such as Grid do not use templates. Only controls that inherit from the Control class use templates.
You cannot create a template for a user control (a control that inherits from the UserControl class), but you can customize a user control by designing it from scratch. For more information, see Create a new user control in your Silverlight 2 project.
Next steps
You can customize the appearance of the system control by modifying properties in the template you just created. For more information, see Modify the appearance of a system control in different states.
You can change the time it takes the button to expand when the mouse pointer moves over it. For more information, see Modify the transition time between state changes in system controls.
You can apply this template to another button in your project, or draw a new button that already has the template assigned. For more information, see Apply a style resource.