Reputation: 5538
I want to inherit and alter the style of the default button but cannot figure out how.
Using:
<Style x:Key="MyBasicButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}"></Style>
does not work, it says the "Type" cannot be used in Windows Store App project
....
Upvotes: 1
Views: 143
Reputation: 9702
You can do it like this:
<Style x:Key="BaseStyle" TargetType="Button">
<Setter Property="Background" Value="Yellow" />
...
</Style>
<Style x:Key="InheritedStyle" TargetType="Button" BasedOn="{StaticResource BaseStyle}">
<Setter Property="Foreground" Value="Red" />
...
</Style>
Upvotes: 1