title: Display "root" node in TreeView
body: <p>How to display the "root" in TreeView?</p>
  
  <p>Do I need to create  a a special HierarchicalDataTemplate for the root?</p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;TreeView Margin="0,0,15,0" Name="treeView1" ItemsSource="{Binding Path=Children}"&gt;           
    &lt;TreeView.Resources&gt;           
      &lt;HierarchicalDataTemplate DataType="{x:Type local:Node}"
                                ItemsSource="{Binding Path=Children}"&gt;
        &lt;Border BorderBrush="Black" BorderThickness="1"&gt;
          &lt;StackPanel&gt;
            &lt;TextBlock Margin="10,0,0,0" Text="{Binding Data}"/&gt;
          &lt;/StackPanel&gt;
        &lt;/Border&gt;
      &lt;/HierarchicalDataTemplate&gt;
    &lt;/TreeView.Resources&gt;
  &lt;/TreeView&gt;
  </code></pre>
  
  <pre class="lang-cs prettyprint-override"><code>Node node0 = new Node("Root");
  Node node1 = new Node("Node1-1");
  Node node12 = new Node("Node1-2");
  Node node21 = new Node("Node2-1");
  Node node22 = new Node("Node2-2");
  Node node31 = new Node("Node3-1");
  Node node9 = new Node("Node9");
  node12.Children.Add(node21);
  node12.Children.Add(node22);
  node22.Children.Add(node31);
  node1.Children.Add(node9);
  
  node0.Children.Add(node1);
  node0.Children.Add(node12);
  treeView1.DataContext = node0;
  
  public class Node
  {      
      List&lt;Node&gt; children;
      public List&lt;Node&gt; Children
      {
          get { return children; }
          set { children = value; }
      }       
  
      string data;
      public string Data
      {
          get { return data; }
          set { data = value; }
      }
  
      public Node()
      {
          children = new List&lt;Node&gt;();
      }
  
      public Node(string data)
          : this()
      {
          this.data = data;
      }
  
  }
  </code></pre>