2012-10-03 48 views
0

我在C:\ Program Files \ Microsoft Expression \ Blend 4 \ SystemThemes \ Wpf文件夹中找到了内置主题;所以我将luna主题(luna.normalcolor.xaml)复制到我的应用程序文件夹中,并编辑这个主题以适合我的需要。我还添加了对PresentationFramework.Luna.dll的引用。 当我打开luna.normalcolor.xaml文件,VS2010显示错误:房产“ContentStringFormat”型“控制”没有被发现,下面几行:WPF控件模板:在'Control'错误中未找到属性'ContentStringFormat'

<DataTemplate DataType="{x:Type CollectionViewGroup}"> 
    <ContentPresenter Content="{Binding Path=Name}" 
      ContentStringFormat="{TemplateBinding ContentStringFormat}"/> 
</DataTemplate> 

我检查了ContentPresenter类有ContentStringFormat属性。那么是什么原因导致 这个错误,以及如何解决它?谢谢。

回答

2

我不知道这是否正常工作,但我想和有没有错误

<DataTemplate DataType="{x:Type CollectionViewGroup}"> 
     <ContentPresenter Content="{Binding Path=Name}" 
          ContentStringFormat="{TemplateBinding ContentPresenter.ContentStringFormat}" /> 
</DataTemplate>