开发者

Silverlight theme error: Cannot find a Resource with the Name/Key System.Windows.Controls.Primitives.DataGridRowHeader

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


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.


Try to use Jeff Willcox's UT toolkit for Mango - http://www.jeff.wilcox.name/2011/06/updated-ut-mango-bits/ Regards

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜