The Silverlight framework (as well as WPF) provides a
resource location to store objects within it. Resources are available at the
application level, user control level, and pretty much
every-other-control-level that it's very handy to create a reusable template
through this scenario, such as:
Listing 8: Reusing control templates
<UserControl.Resources>
<ControlTemplate x:Key="MyCustomTemplate">
<Border BorderBrush="Beige" BorderThickness="2">
<TextBlock Margin="20" Text="My templated content via resources" />
</Border>
</ControlTemplate>
</UserControl.Resources>
.
.
<HeaderedContentControl HeaderTemplate="{StaticResource MyCustomTemplate}" />
Any control can override the default template by providing a
custom template using the StaticResource keyword. This keyword designates a
resource stored in the UserControl's resources collection, and will dynamically
supply the template at runtime.