create templates and styles by making copies of the default system styles and templates for a control (because you can'tmodify system styles and templates). Modifying templates and styles is an easy way to essentially make new controlsin Design view of Microsoft Expression Blend, without having to use code.
The difference between styles and templates
The following table provides a detailed comparison of styles and templates to help you decide whether you want tomodify the style or template of a control, or both.
Characteristic Styles Templates
By using styles, you canmodify the default valuesof properties that are set onthe control to which thestyle is applied. Forexample, you can specifydefault colors for thebackground, border, andforeground of a controlsuch as a button.These style properties canbe overridden by the valuesthat are set on the controlitself when it is drawn onthe artboard. For example,if you set the backgroundcolor to blue in the style of a button, the button willUsing templates, you can modifythe structure of the control towhich the template is applied. Youcan modify a control template torearrange, add, or delete theelements (or parts) in the control.For example, you can add abackground image or design to acontrol such as a button.You can also modify the values of properties (such as backgroundcolor) that are set on the control towhich the template is applied.These template values cannot beoverridden by the values that areset on the control itself when it isdrawn on the artboard. However,you can use template-binding toset the properties of a templateaccording to the values of properties of the control when it isdrawn on the artboard.When you modify a template, youhave access to more parts of acontrol than when you modify astyle. For example, you canchange the way the pop-up listappears in a combo box, or youchange the look of the button thattriggers the pop-up list in thecombo box by modifying the itemstemplate. Some templates consistof the following parts:
Content Presenter Acontent presenter is aplaceholder in the controltemplate to display thecontent of the control towhich the template isapplied. This might be thevalue of a content property(in a button for example), or
Page 3of 65Styles and templates6/16/2009file://C:\Windows\Temp\~hhD0B.htm