&引用;继承;wpf中的主题风格

&引用;继承;wpf中的主题风格,wpf,xaml,styles,Wpf,Xaml,Styles,我正在使用CodePlex中的一个主题,我想在样式上添加一些修改,但不想更改它们的代码。如何继承主题样式 <Style x:Key="Style1"> <Setter Property="Control.Background" Value="Yellow"/> </Style> <Style x:Key="Style2" BasedOn="{StaticResource Style1}"> <Setter Property="Con

我正在使用CodePlex中的一个主题,我想在样式上添加一些修改,但不想更改它们的代码。如何继承主题样式

<Style x:Key="Style1"> <Setter Property="Control.Background" Value="Yellow"/> </Style> <Style x:Key="Style2" BasedOn="{StaticResource Style1}"> <Setter Property="Control.Foreground" Value="Blue"/> </Style> MSDN参考:

另一个示例(基于没有显式键的样式):


只需通过XAML或代码在基本资源字典之后加载扩展资源字典。

所有样式都有键,键要么是ID,例如“Style1”,要么是隐式或显式控件类型,例如“BasedOn=“{StaticResource{x:type ComboBox}” <Style x:Key="Style3" BasedOn="{StaticResource {x:Type ComboBox}}"> <Setter Property="Control.Foreground" Value="Blue"/> </Style>