title: Having HierarchicalDataTemplates in a TreeView
body: <p><em>With regards to a question I posted earlier on (<a href="https://stackoverflow.com/questions/718858/wpf-correctly-storing-an-object-in-a-treeviewitem/718895#718895">WPF: Correctly storing an object in a TreeViewItem</a>)</em></p>
  
  <p><strong>Is it possible to have nested <code>HierarchicalDataTemplate</code>s in a TreeView?</strong></p>
  
  <hr>
  
  <p>Take the following example: </p>
  
  <p><em>Code:</em></p>
  
  <pre><code>public class Artist
  {
          private readonly ICollection&lt;Album&gt; _children = new ObservableCollection&lt;Album&gt;();
          public string Name { get; set; }
  
          public ICollection&lt;Album&gt; Albums
          {
              get { return _children;}
          }
  }
  
  public class Album
  {
          private readonly ICollection&lt;Track&gt; _children = new ObservableCollection&lt;Track&gt;();
          public string Name { get; set; }
  
          public ICollection&lt;Track&gt; Tracks
          {
              get { return _children;}
          }
  }
  </code></pre>
  
  <p><em>Xaml:</em></p>
  
  <pre><code>&lt;TreeView x:Name="_treeView"&gt;
          &lt;TreeView.Resources&gt;
                  &lt;HierarchicalDataTemplate DataType="{x:Type local:Artist}" ItemsSource="{Binding Albums}"&gt;
                          &lt;TextBlock Text="{Binding Name}"/&gt;
                  &lt;/HierarchicalDataTemplate&gt;
          &lt;/TreeView.Resources&gt;
  &lt;/TreeView&gt;
  </code></pre>
  
  <p>As you see from the above, the TreeView is only binding the Artists and their albums.  How can I modify it to include also the Tracks of the albums (as a sub-list of the albums ie) ?</p>