I have the following style defined in the ResourceDictionary of a Silverlight 4.0 application
<Style x:Key="GridSplitterStyle" TargetType="sdk:GridSplitter">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template" Value="{StaticResource GridSplitterTemplate}" />
</Style>
<ControlTemplate x:Key="GridSplitterTemplate" TargetType="sdk:GridSplitter">
<StackPanel Background="Transparent" Height="32">
<!-- ... -->
</StackPanel>
</ControlTemplate>
When I apply the style on my GridSplitter, the style is found and properly applied. However, when linking the Template property to the ControlTemplate defined in the same dictionary file, the following error comes up:
Cannot find a Resource with the Name/Key GridSplitterTemplate
How come Silverlight can find the style but not the template? They are located in the same file...