0
可能重复:
How to apply multiple styles in WPF如何在wpf中将multy风格应用于单一控件?
<Window.Resources>
<Style TargetType="Button" x:Key="style_1">
<Setter Property="Foreground" Value="Green" />
</Style>
<Style TargetType="Button" x:Key="style_2">
<Setter Property="Background" Value="Blue" />
</Style>
</Window.Resources>
<Button x:Name="btn_1" Content="Button" HorizontalAlignment="Left" Height="40" Margin="153,95,0,0" VerticalAlignment="Top" Width="89" Style="{StaticResource style_1}" Click="Button_Click" />
<Button x:Name="btn_2" Content="Button" Height="40" Margin="281,95,262,0" VerticalAlignment="Top" Style="{StaticResource style_2}"/>
现在我想申请style_1和style_2到btn_1我应该做到这一点。