I want to use a global Style in WP7, something like:
<Style TargetType="Button">
//some code here
</Style>
The problem is that this code does not seem to work in WP7.
I know how to add x:Key to the Style and after that how to reference it as a StaticResource, but this is not my case. I want a global Style.
If I create an application wide (global) style like this:
<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>
Then I can refer to it like this:
<TextBlock Text="some text" Style="{StaticResource MyTextNormalStyle}" />
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