views:

424

answers:

1

I have got an(other) error while trying to upgrade our large project to SL4. I didn't write the original theme and my theme knowlege isn't great. In my SL3 app I have a datagrid themed like so:

 <!--Datagrid Style-->
    <Style TargetType="datagrid:DataGrid">
        <Setter Property="RowHeaderStyle" Value="{StaticResource System.Windows.Controls.Primitives.DataGridRowHeader}"/>
        <Setter Property="RowBackground" Value="Transparent"/>
        <Setter Property="etc" Value="..."/>
    </Style>

When I upgrade to SL 4 the first line in the XAML above gives a runtime error:
Cannot find a Resource with the Name/Key System.Windows.Controls.Primitives.DataGridRowHeader

Should I handle this differently in SL4?

EDIT: From the answer given it appears this should never have worked. Like i say i didn't write the original theme, so not sure what it's trying to do. If I do a search for that static resource line it does come up in a couple of places. Do you know what it was trying to acheive? Do you think I can safely remove the theme properties that are using this way of referencing (there aree several places where a control is referenced like this in the theme I have)?

TIA

Mark

Example showing error:
http://walkersretreat.co.nz/files/SilverlightApplication1.zip

+2  A: 

Mark -- do you have a resource with that name? SL4 XAML parser got improved and more strict. I don't see a resource with that name anywhere in your project so the parser is puking on it.

Tim Heuer
I agree, that resource name looks sus.
Igor Zevaka
Thanks guys, like i say i didn't write the original theme, so not sure what it's trying to do. if I do a search for that static resource line it does come up in a couple of places.Do you know what it was trying to acheive? Do you think I can safely remove those bits?
Mark
And, no, there isn't a resource with that name - it appears to be trying to reference the control directly...??
Mark
If you want the default style, then yes you can remove them. In fact, you can remove the style reference on the datagrid you are using and get the default style.
Tim Heuer