2013-08-23 39 views
0

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

但是,当我为控件下载样式我有错误对象引用未设置为对象的实例。

你可以在截图中看到这个。 enter image description here

或这个。线路:336

<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..>

,如果我删除

Fill="{DynamicResource {ComponentResourceKey {x:Type igDP:XamDataGrid}, CardBackground}}" 

误差不会

请告诉我什么是错?

+0

您是否使用从风格您在博客文章中提供的示例Kiril,还是您以默认安装的当前使用的控件版本的默认样式开始?你也有一个已经重现了这个问题的例子项目吗?如果是这样,你可以将它张贴在某个地方吗? – alhalama

回答

1

尝试以下操作:

<Rectangle Fill="{DynamicResource {ComponentResourceKey 
TypeInTargetAssembly={x:Type igDP:XamDataGrid}, 
ResourceId=CardBackground}}" /> 

,我认为你将有一个属性为CardBackground,也许你有像以下问题的家伙的错误:Getting a ComponentResourceKey to Work?

+0

是的。那么目标已经在你的xaml中设置了 – Alex

+0

行327和495行什么? – Tobias

+0

我编辑过的问题 – Alex