title: Changing Foreground of a TreeViewItem upon selection
body: <p>In my program I have a <code>TreeView</code> in which the user will select different items from. There are a few items in my <code>TreeView</code> that are customized upon creation in my c# code-behind.</p>
  
  <p>Like so:</p>
  
  <pre><code>public static TreeViewItem newItem = new TreeViewItem() //Child Node
  {
         Header = new StackPanel //ICON
         {
             Orientation = Orientation.Horizontal,
             Children =
             {
                 new Border {
                     Width = 12,
                     Height = 14,
  
                     Background = Brushes.Blue,
                     BorderThickness = new Thickness(1.0),
                     BorderBrush = Brushes.Black
                },
                new Label {
                    Content = "Node1"
                }
             }
        }
  };
  </code></pre>
  
  <p>I would like these items to display WHITE <code>foregrounds</code> when they are selected (just like the default node behavior).</p>
  
  <p>This is what I have tried so far in XAML. It is a style template that I have set for <code>TreeViewItems</code>. I receive no compiler errors, but for some reason when I run the program my <code>TreeView</code> is not visible.</p>
  
  <pre><code>&lt;Style TargetType="{x:Type TreeViewItem}" &gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type TreeViewItem}"&gt;
                          &lt;ControlTemplate.Triggers&gt;
                              &lt;Trigger Property="IsSelected" Value="True" &gt;
                                  &lt;Setter Property="Foreground" Value="White" /&gt;
                              &lt;/Trigger&gt;
                              &lt;Trigger Property="IsSelected" Value="False" &gt;
                                  &lt;Setter Property="Foreground" Value="Black" /&gt;
                              &lt;/Trigger&gt;
                          &lt;/ControlTemplate.Triggers&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>How can I fix this so that all of my <code>TreeView</code> nodes display white <code>foregrounds</code> when selected?</p>