I'm using one of the themes in CodePlex and I want to add some modifications on the style but not to change their code. How can I inherit the theme style?
<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 reference: http://msdn.microsoft.com/en-us/library/system.windows.style.basedon.aspx
Another example (basing a style on a style with no explicit key):
<Style x:Key="Style3" BasedOn="{StaticResource {x:Type ComboBox}}"> <Setter Property="Control.Foreground" Value="Blue"/> </Style>
Just load the extending resource dictionary after the base resource dictionary via XAML or code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With