Can I create parametrized control template, i.e. create control template which might contain different controls. For instance, I can use control template with label or with button - whatever I want in some position.
<ControlTemplate x:Key="MessageCTemplate">
<Grid …>
<Rectangle …/>
<Rectangle …/>
<Rectangle …/>
…
<!--I want to have here button, label or whatever I want-->
<label x:Name=”MsgLabel”>
<Grid/>
<Style x:Key="MsgStyle" TargetType="{x:Type Button}">
<Setter Property="Opacity" Value="0.6" />
<Setter Property="Template" Value="{StaticResource MessageCTemplate}" />
<Style/>
I don’t feel happy to write the same control templates which has only one different string in their code. Or, perhaps, I misunderstand smth and another way of avoiding copy-past exists.