title: Binding a List of Objects to a TreeView
body: <p>I have a list of objects and I'm trying to bind it to a TreeView in WPF:</p>
  
  <pre><code>private List&lt;SlideIssue&gt; slideIssuesList = new List&lt;SlideIssue&gt;();
  </code></pre>
  
  <p>Here the XAML:</p>
  
  <pre><code>&lt;Grid Grid.Row="2"&gt;
      &lt;TreeView x:Name="mainTreeView" BorderThickness="0"&gt;
  
      &lt;/TreeView&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>And the binding attempt:</p>
  
  <pre><code>TreeViewItem item = new TreeViewItem();
  item.HeaderTemplate = headerTemplate;
  
  foreach (var issue in slideIssuesList)
  {
      if (slideNumber == issue.SlideNumber)
      {                                            
          TreeViewItem child = new TreeViewItem();
  
          child.ItemsSource = slideIssuesList;
  
          child.HeaderTemplate = itemTemplate;
          item.Items.Add(child);
      }
  }
  item.IsExpanded = true; 
  mainTreeView.Items.Add(item);
  </code></pre>
  
  <p>At runtime, this is what I get:</p>
  
  <p><img src="https://i.stack.imgur.com/cRJUP.jpg" alt="Here is the picture"></p>
  
  <p>I want to access the particular Properties of the "SlideIssue" Object. How do I do that?</p>