Wpf XAML:使用VS主题颜色制作TreeViewItem

Wpf XAML:使用VS主题颜色制作TreeViewItem,wpf,xaml,colors,visual-studio-2013,treeview,Wpf,Xaml,Colors,Visual Studio 2013,Treeview,我正在创建一个带有工具窗口的VisualStudio扩展。在那里,我使用树视图。我希望此树视图使用当前的Visual Studio主题。多亏了这篇文章,我才能够设置文本的颜色并突出显示颜色。但还有更多问题: 颜色仅在visual studio重新启动时更新,但在我更改主题时不会直接更新 如何更改未聚焦的高光颜色 如何将可展开图标颜色更改为当前主题颜色 在解决方案资源管理器窗口中,是否有机会使突出显示显示完全覆盖 以下是我当前的XAML代码: <UserControl x:Class="

我正在创建一个带有工具窗口的VisualStudio扩展。在那里,我使用树视图。我希望此树视图使用当前的Visual Studio主题。多亏了这篇文章,我才能够设置文本的颜色并突出显示颜色。但还有更多问题:

  • 颜色仅在visual studio重新启动时更新,但在我更改主题时不会直接更新
  • 如何更改未聚焦的高光颜色
  • 如何将可展开图标颜色更改为当前主题颜色
  • 在解决方案资源管理器窗口中,是否有机会使突出显示显示完全覆盖
以下是我当前的XAML代码:

<UserControl x:Class="DavidSpeck.CSharpDocOutline.DocOutlineView"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:shell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.12.0"
         Background="{DynamicResource VsBrush.Window}"
         Foreground="{DynamicResource VsBrush.WindowText}"
         mc:Ignorable="d"
         d:DesignHeight="300" d:DesignWidth="300"
         Name="MyToolWindow">
<UserControl.Resources>
    <Style x:Key="CETreeViewItem" TargetType="{x:Type TreeViewItem}">
        <Style.Resources>
            <SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="{DynamicResource {x:Static shell:VsColors.ToolWindowTextKey}}" />
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="{DynamicResource {x:Static shell:VsColors.HighlightKey}}" />
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="{DynamicResource {x:Static shell:VsColors.HighlightTextKey}}" />
        </Style.Resources>
    </Style>
</UserControl.Resources>
<Grid>
    <StackPanel Orientation="Vertical">
        <TreeView Name="outlineTreeView" 
                  Background="{DynamicResource VsBrush.Window}"
                  BorderThickness="0"
                  ItemContainerStyle="{StaticResource CETreeViewItem}">
        </TreeView>
    </StackPanel>
</Grid>