I have a onetime Style
and corresponding ControlTemplate
for a custom HyperLinkButton
in Blend 4
(for Silverlight).
Documentation for Blend says :
Control templates are wrapped inside styles so that the style that is applied to a control includes both the appearance (parts) and the behavior for the control. (from here) and (also here)
So I click my HyperlinkButton
on the artboard and select Object > Edit Template > Edit a copy
and I get:
<HyperlinkButton Template="{StaticResource HyperlinkButtonControlTemplate}"/>
Well thats not wrapped in a style is it!
SO I start over again and try to create a style with Object > Edit Style > Edit a copy
and that gives me a new style, but no template (as expected):
<Style x:Key="HyperlinkButtonStyle2" TargetType="HyperlinkButton">
<!--Setter Property="TargetName" Value="_new"/-->
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Foreground" Value="Blue"/>
<Setter Property="Padding" Value="0"/>
</Style>
Now I have a style with no control template. Then I select that style in Styles.xaml
and do Edit Template > Edit a copy
and it adds a linked ControlTemplate to the style:
<Style x:Key="HyperlinkButtonStyle2" TargetType="HyperlinkButton">
<!--Setter Property="TargetName" Value="_new"/-->
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Foreground" Value="Blue"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Template" Value="{StaticResource HyperlinkButtonControlTemplate2}"/>
</Style>
BUT The documentation for Blend 4 says that it will be created within a style, but it isn't. I absolutely see this as more flexible, but its not what I want becuase I don't want to reuse it and I'm wondering if this is configurable or I'm missing something .
SO: Can I make Blend 4 create a Style
and nested ControlTemplate
at the same time or do I have to manually move the ControlTemplate
into the Style
?