WPF: ControlTemplate vs Style that Changes Template
Inside App.xaml I may have:
<Style TargetType="{x:Type Button}" x:Key="roundButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate Target="{x:Type Button}">
bla bla bla...
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
vs. just going
<ControlTemplate Target="{x:Type Button}" x:Key="roundButton">
bla bla bla...
</ControlTemplate>
I'm confused, which should I use开发者_如何学JAVA / what's the difference?
Using the Style you could also change other values of the button at the same time. Using the ControlTemplate you can only change the template. So which is appropriate?
精彩评论