Can I use generic.xaml in Silverlight to set the style of all TextBlock in the application?
<ResourceDictionary xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="TextBlock">
<Setter Property="Foreground"
Value="White" />
<Setter Property="FontSize"
Value="24" />
</Style>
</ResourceDictionary>
I was expecting this to work but it doesn't :-(
Whats the simplest way to apply styles across a whole application??
Thanks, Mark
EDIT
Thanks for your response. I'm not getting an error, the styles just aren't being applied. All the examples that I found on the internet (including the ones you have listed) are all for styling custom controls. This I can do, but I'd like to just style the default controls:
<TextBlock Text="Style me!!" Grid.Row="2" />
Do I need to add reference to the generic.xaml from page.xaml?? Do I need to name and reference the generic.xaml style as a resource??
Thanks again, Mark