title: How do you highlight TreeViewItem?
body: <p>I have a simple treeview with all the default colors.  When you click on an item it is highlighted and the background turns blue.  Fine so far.  I'm trying to do the same thing in the code behind so that I can have a treeview item of my choice highlighted in blue.  The only property I see that I have found that changes the background is ".IsSelected".  But when I set that to true the treeview item is highlighted in white.  I don't get it.  I'm not setting the highlight color to anything so why would it pick a different highlight color than when you select that same item with a mouse click?  Is "highlight" a different property than "select" and if so how what is the name of that property?  </p>
  
  <p>Thanks.</p>
  
  <p>Edit: Adding code (My apologies, this was so simple so I didn't think anyone would want to see the code)</p>
  
  <p>Xaml: (and yes, this the entire code. Just plug it into a project and it'll run.)</p>
  
  <pre><code> &lt;Window x:Class="TestTreeView.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Tree View Icon"
  ShowInTaskbar="false"
  Name ="MyTestTreeView"
  Background="Beige"
  Width="500"
  Height ="500"
  &gt;
  &lt;StackPanel Name="stackpanel"&gt;
      &lt;Button Name="AddNode" Click="btnClick"&gt;
              AddNode
      &lt;/Button&gt;
  
      &lt;ScrollViewer HorizontalScrollBarVisibility="auto" VerticalScrollBarVisibility="hidden" Name="scrollViewer"&gt;
          &lt;TreeView Name="treeView" BorderThickness="0"&gt;
              &lt;TreeView.Resources&gt;
                  &lt;SolidColorBrush Color="Red" x:Key="{x:Static SystemColors.HighlightBrushKey}"/&gt;
              &lt;/TreeView.Resources&gt;
          &lt;/TreeView&gt;
      &lt;/ScrollViewer&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p></p>
  
  <p>Code behind:</p>
  
  <pre><code>using System.Windows.Shapes;
  using System.IO;
  namespace TestTreeView
  {
      public partial class Window1 : System.Windows.Window
      {
          public Window1()
          {
              InitializeComponent();
          }       
          public void btnClick(object sender, RoutedEventArgs e)
          {
              TreeViewItem n1 = new TreeViewItem();
              n1.Header = "Top Node";
              n1.IsSelected = true;
              n1.Focus();
              treeView.Items.Add(n1);          
          }
      }
  }
  </code></pre>