C# 第一个GridViewColumnHeader未接收自定义GridViewColumnHeaderStyle
我一直在开发一个Wpf项目,其中包括一个DfcListView类(从ListView类继承)。在文件“DfcListView.xaml”中,我有以下代码来定义DfcListViewGridViewColumnHeaderStyle(一种GridViewColumnHeader样式):C# 第一个GridViewColumnHeader未接收自定义GridViewColumnHeaderStyle,c#,wpf,xaml,C#,Wpf,Xaml,我一直在开发一个Wpf项目,其中包括一个DfcListView类(从ListView类继承)。在文件“DfcListView.xaml”中,我有以下代码来定义DfcListViewGridViewColumnHeaderStyle(一种GridViewColumnHeader样式): 然后,在xaml文件“Generic.xaml”中,我有: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/x
然后,在xaml文件“Generic.xaml”中,我有:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DataFlowControls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/DataFlowControls;component/Themes/DfcEditCheckBox.xaml" />
<ResourceDictionary Source="/DataFlowControls;component/Themes/DfcEditComboBox.xaml" />
<ResourceDictionary Source="/DataFlowControls;component/Themes/DfcEditTextBox.xaml" />
<ResourceDictionary Source="/DataFlowControls;component/Themes/DfcListview.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
此代码工作正常,但结果DfcListView中的第一个GridViewColumnHeader未接收DfcListViewGridViewColumnHeaderStyle。所有其他栅格视图列标题接收DfcListViewGridViewColumnHeaderStyle如何修改代码,使第一个GridViewColumnHeader也能接收DfcListViewGridViewColumnHeaderStyle?
我在stackoverflow.com上读过一些关于这类问题的其他文章,但我还无法从中找到解决方案。我刚刚计算出,如果我从代码中删除以下内容(请参见上面的代码),它会起作用: x:Key=“DfcListViewGridViewColumnHeaderStyle”
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DataFlowControls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/DataFlowControls;component/Themes/DfcEditCheckBox.xaml" />
<ResourceDictionary Source="/DataFlowControls;component/Themes/DfcEditComboBox.xaml" />
<ResourceDictionary Source="/DataFlowControls;component/Themes/DfcEditTextBox.xaml" />
<ResourceDictionary Source="/DataFlowControls;component/Themes/DfcListview.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>