I have a datagrid in silverlight 4 like below
<data:DataGrid x:Name="Test">
<data:dataGrid.Columns>
<data:DataGridColumnTextColumn Header="File Name" HeaderStyle="{StaticResource MyResource}"/>
</data:DataGrid.Columns>
</data:DataGrid>
Here's the Resource file property
<Style TargetType ="System_Windows_Controls_Primitives:DataGridColumnHeader" x:Name="MyResource">
<Setter Property="Foreground" Value="#FF"/>
</style>
the xmlns I use is xmlns:data = "clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
- This was working in Silverlight 3 but not in Silverlight 4
The issue is that the program is throwing an error that the given key is not present in the dictionary which is not true since it is there in the resource file. It can clearly get other keys for other properties like Header Name etc but not the HeaderStyle . Can someone tell me what I am doing wrong here.
Thanks