<TextBlock Text="Text1" Style="{StaticResource key1}"/>
<TextBlock Text="Text2" Style="{StaticResource key1}"/>
<TextBlock Text="Text3" Style="{StaticResource key1}"/>
xmlns:theming="clr-namespace:Microsoft.Windows.Controls.Theming; assembly=Microsoft.Windows.Controls.Theming"
<StackPanel x:Name="stackPanel" theming:ImplicitStyleManager.ApplyMode="OneTime">
<TextBlock Text="Static Text 1" />
<TextBlock Text="Static Text 2" />
<StackPanel>
5) Of course, you should have defined the style somewhere in the resources collection as shown below:
<Application.Resources>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Red" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Margin" Value="5" />
<Style>
<Application.Resources>
Now you are good to go. The ImplicitStyleManager will ensure that the style is passed down to the TextBlock down the element tree.
If you dynamically add a TextBlock to the element tree (at run time), you will find that the TextBlock will not get the style. In this case, you will have to set ImplicitStyleManager.ApplyMode="Auto". But setting it to Auto can have a major performance impact, so use this sparingly.
There you go - implicit styles in Silverlight :).
