我想在选择树视图项时更改材质设计xaml的默认颜色。这是我在资源字典中使用的代码。
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:materialDesign="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
>
<Style x:Key="MaterialDesignTreeView" TargetType="{x:Type TreeView}" BasedOn="{StaticResource MaterialDesignTreeView}">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Green" />
</Style.Resources>
</Style>
<Style x:Key="MaterialDesignTreeViewItem" TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource MaterialDesignTreeViewItem}">
<Setter Property="Padding" Value="2"/>
</Style>
</ResourceDictionary>
我能够覆盖填充但不覆盖所选树视图项的颜色。有什么想法吗?