title: Display Hierarchical Data in TreeView
body: <p>I am simply trying to display hierarchical Data in a TreeView, but I just can't figure out how to make it display more than the First two Levels. (And i have read almost evry TreeView post, maybe the problem is my (miss)understatement of the Bindings in this case)</p>
  
  <p>I have simplyfied my Datastructure for this test: </p>
  
  <pre><code>public class Node
  {
      public List&lt;Node&gt; Children { get; set; }
  
      public Node Parent { get; set; }
  
      public string Expression { get; set; }
  }
  </code></pre>
  
  <p>Xaml currently looks like this: (Please notice that I have changed it several times now, but this here is the original state i have come up with: )</p>
  
  <pre><code>&lt;Window x:Class="Klammern_Test.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:Klammern_Test"
          Title="MainWindow" Height="439" Width="402"&gt;
      &lt;Window.Resources&gt;
          &lt;HierarchicalDataTemplate DataType="{x:Type local:Node}"&gt;
              &lt;TreeViewItem ItemsSource="{Binding Children}" Header="{Binding Expression}"/&gt;
          &lt;/HierarchicalDataTemplate&gt;
      &lt;/Window.Resources&gt;
      &lt;Grid&gt;
          &lt;TreeView ItemsSource="{Binding Root}" Margin="12,41,12,12" Name="treeView" /&gt;            
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>And this is how I am trying to Populate my Treeview:</p>
  
  <pre><code>public partial class MainWindow : Window
  {
          public Node Root { get; set; }
  
          public MainWindow()
          {
              InitializeComponent();
              DataContext = this;
  
          }
  
          private void StartButton_Click(object sender, RoutedEventArgs e)
          {
              Parser = new StringParser();
              Root = Parser.Parse(Tbx_Eingabe.Text);       
              treeView.Items.Add(PopulateTreeView(Root));
  
  
  
          }
  
          private TreeViewItem PopulateTreeView(Node node)
          {
              TreeViewItem treeViewItem = new TreeViewItem();
              treeViewItem.IsExpanded = true;
              treeViewItem.Header = node.Expression;
  
  
              foreach (Node child in node.Children)
              {
                  treeViewItem.Items.Add(new TreeViewItem() { Header = child.Expression });
  
                  if (child.Children.Count &gt; 0)
                  {
                      PopulateTreeView(child);
                  }
              }
  
              return treeViewItem;
          }
  }
  </code></pre>
  
  <p>What am I missing? </p>
  
  <h2>EDIT:</h2>
  
  <p>After trying around with almulo's hints, I found this with the Snoop-tool, but I can't tell what it means at all, I have found no other red line and no entry to the Binding Errors column at all.</p>
  
  <p><img src="https://i.stack.imgur.com/PMpgz.png" alt="Snoop screenshot of potential binding Error"></p>