我想继承并改变默认按钮的样式,但无法弄清楚如何。
使用:
<Style x:Key="MyBasicButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}"></Style>
不起作用,它说"Type" cannot be used in Windows Store App project
....
答案 0 :(得分:1)
你可以这样做:
<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>