title: First TreeViewItem not being styled (MahApps Metro TreeView)
body: <p>I'm using MahApps Metro Styling in WPF and trying to add a style to the TreeViewItem  so that the nodes have a folder icon next to them. (<a href="http://mahapps.com/MahApps.Metro/" rel="nofollow noreferrer">http://mahapps.com/MahApps.Metro/</a>)</p>
  
  <p>This is fairly straight forward, all I have to do is override the TreeViewItem header template and add in the image.</p>
  
  <p>The problem is that for some reason the new template is not applied to the first entry in the tree as you can see blow:</p>
  
  <p><img src="https://i.stack.imgur.com/6QLbr.jpg" alt="TreeViewItem Style"></p>
  
  <p>All other tree nodes work fine but the first one refuses to have the style applied.</p>
  
  <p>I have confirmed that this is something to do with the MahApps TreeView styling contained in Controls.TreeView.xaml (a new project without MahApps but with the same custom style works as expected) but I cannot see exactly what is going on.</p>
  
  <p>Does anyone have any experience styling TreeViewItems when using MahApps?</p>
  
  <pre><code>&lt;TreeView Grid.Column="0" Name="FolderView"&gt;
  
          &lt;TreeView.Resources&gt;
              &lt;Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource MetroTreeViewItem}"&gt;
                  &lt;Setter Property="HeaderTemplate"&gt;
                      &lt;Setter.Value&gt;
                          &lt;DataTemplate&gt;
                              &lt;StackPanel Orientation="Horizontal"&gt;
                                  &lt;Image Name="img"
                                      Width="16"
                                      Height="16"
                                      Stretch="Fill"
                                      Source="Images/Folder.png"
                                      Margin="3"   
                                      VerticalAlignment="Center"
                                     /&gt;
                                  &lt;TextBlock Text="{Binding}" Margin="0,0" VerticalAlignment="Center" /&gt;
                              &lt;/StackPanel&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Style&gt;
          &lt;/TreeView.Resources&gt;
      &lt;/TreeView&gt;
  </code></pre>