I know how to change a SystemColor for a specific UIElement like this
<DataGrid>
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="LightGray" />
</DataGrid.Resources>
</DataGrid>
But I want to make this setting for all DataGrid
s in my app. How can I set this up in my app.xaml
file to make it work? This obviously does not work:
<Style TargetType="{x:Type DataGrid}">
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="LightGray" />
</Style>
Put it in the resources of the Style
:
<Style TargetType="DataGrid">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="LightGray" />
</Style.Resources>
</Style>