我想在WP7中使用全局样式,类似于:
<Style TargetType="Button">
//some code here
</Style>
问题是这段代码似乎在WP7中无法工作。
我知道如何给样式添加x:Key,之后可以将其作为StaticResource进行引用,但这不是我的情况。我想要一个全局样式。
我想在WP7中使用全局样式,类似于:
<Style TargetType="Button">
//some code here
</Style>
问题是这段代码似乎在WP7中无法工作。
我知道如何给样式添加x:Key,之后可以将其作为StaticResource进行引用,但这不是我的情况。我想要一个全局样式。
<Application.Resources>
<Style x:Key="MyTextNormalStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}" />
<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}" />
</Style>
</Application.Resources>
<TextBlock Text="some text" Style="{StaticResource MyTextNormalStyle}" />