views:

95

answers:

1

I am not knowing what to use to override an existing template (either ContentTemplate, Content). Imagine I have the following:

<Style x:Key="ComboBoxItemStyle1" TargetType="ComboBoxItem">
.
.
<ControlTemplate TargetType="ComboBoxItem">
.
.
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/>

What is the difference between "ContentTemplate" and "Content" in the above markup (also, what is good for what).

Also, where can I find more information on "TemplateBinding"?

thanks

A: 

Content is generally used for your data. It will be set to the DataContext of the your ContentTemplate DataTemplate. The benefit of Content vs. ContentTemplate is the ability to change the ContentTemplate to display the same content in a different fashion.

Template Binding

Stephan