WPF DataGrid行标题样式TargetType

WPF DataGrid行标题样式TargetType,wpf,xaml,wpfdatagrid,Wpf,Xaml,Wpfdatagrid,我可以为这个“红色”元素设置样式吗 我可以在DataGridColumnHeader、DataGridRowHeader上设置样式,但我不知道如何在“red”元素上设置样式。您是指DataGrid的左上角吗? 这是一个按钮类型。可以对其应用自定义样式 <DataGrid.Resources> <Style TargetType="Button" x:Key="{ComponentResourceKey ResourceId=DataGridSelectAllButton

我可以为这个“红色”元素设置样式吗


我可以在DataGridColumnHeader、DataGridRowHeader上设置样式,但我不知道如何在“red”元素上设置样式。

您是指DataGrid的左上角吗? 这是一个按钮类型。可以对其应用自定义样式

<DataGrid.Resources>
    <Style TargetType="Button" x:Key="{ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}">
        <Setter Property="Background" Value="Red" />
    </Style>
</DataGrid.Resources>

结果如下


您是指数据网格的左上角吗? 这是一个按钮类型。可以对其应用自定义样式

<DataGrid.Resources>
    <Style TargetType="Button" x:Key="{ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}">
        <Setter Property="Background" Value="Red" />
    </Style>
</DataGrid.Resources>

结果如下


是的!谢谢:)如果您觉得这有帮助,请将其标记为答案。谢谢。@A.Klim请记住接受答案以结束您的问题:是!谢谢:)如果您觉得这有帮助,请将其标记为答案。谢谢。@A.Klim请记住接受答案以结束您的问题: