1. Button的样式
Button的XAML代码如下:
<Style TargetType="Button" x:Key="buttonStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <!--Define the ControlTemplate here.--> </ControlTemplate> </Setter.Value> </Setter> </Style>
下面代码是调用Button样式:
<Button Width="100" Height="40" Content="Hello" Style="{StaticResource buttonStyle}" />