首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WPF XamdataGrid优化

WPF XamdataGrid优化
EN

Stack Overflow用户
提问于 2013-08-23 16:48:13
回答 1查看 736关注 0票数 0

我有一个优化xamdatagrid的问题。我正在尝试使用这个http://www.infragistics.com/community/blogs/kiril_matev/archive/2010/10/26/optimizing-xamdatagrid-performance.aspx

但是当我下载控件的样式时,我得到了错误的object reference not set to a instance of a Object。

你可以在截图上看到这一点。

或者这个。线路:336

代码语言:javascript
复制
<Setter Property="TemplateCardView">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type igDP:DataRecordPresenter}">
                <igWindows:CardPanel x:Name="baseGrid" Background="{TemplateBinding Background}">
                    <!-- Record Content -->
                    <Rectangle Fill="{DynamicResource {ComponentResourceKey {x:Type igDP:XamDataGrid}, CardBackground}}" />
                    <ContentPresenter x:Name="PART_RecordContentSite" Content="{TemplateBinding DataContext}" ContentTemplate="{TemplateBinding {ComponentResourceKey {x:Type igDP:DataRecordPresenter}, RecordContentAreaTemplate}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                </igWindows:CardPanel>
            </ControlTemplate>
        </Setter.Value>
    </Setter>

<ControlTemplate..>指示的错误

如果我移除

代码语言:javascript
复制
Fill="{DynamicResource {ComponentResourceKey {x:Type igDP:XamDataGrid}, CardBackground}}"

错误将不会

请告诉我出了什么问题?

EN

回答 1

Stack Overflow用户

发布于 2013-08-23 17:14:00

尝试以下操作:

代码语言:javascript
复制
<Rectangle Fill="{DynamicResource {ComponentResourceKey
TypeInTargetAssembly={x:Type igDP:XamDataGrid},
ResourceId=CardBackground}}" />

我认为你会有一个CardBackground的属性,也许你有一个错误,就像下面这个问题中的那个人:Getting a ComponentResourceKey to Work?

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18398613

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档