title: Setting up a TreeView in Silverlight with a HierarchicalDataTemplate and Binding with ItemSource
body: <p>I am trying to build a TreeView and have it set up like this link:</p>
  
  <p><a href="https://stackoverflow.com/questions/4319358/silverlight-vs-wpf-treeview-with-hierarchialdatatemplate">Silverlight vs WPF - Treeview with HierarchialDataTemplate</a></p>
  
  <p>As a comment to the first actual answer provided the poster says how they solved it but they didn't provide code and I understand what they said but I am really new to this and can't get it right.  I have the same set-up structure with the entities and groups.  I was wondering if some one could explain what the xaml ended up looking like.  I am assuming by saying they made a new node class it just means they made a class that contains essentially a list of groups.  Something like <br></p>
  
  <pre><code>class groupHolder
  {
     public List&lt;Group&gt; myGroups {get;set;}
     public groupHolder() { myGroups = new List&lt;Group&gt;(); } 
  }
  </code></pre>
  
  <p>I am just trying to go three levels deep:</p>
  
  <p>Group 1 <br>
  - - - - AnotherGroup1 <br>
  - - - - - - - - entity1 <br>
  - - - - - - - - entity2 <br>
  - - - - AnotherGroup2<br>
  - - - - - - - - entity1<br>
  Group2<br>
  - - - - Entity1<br>
  - - - - Entity2<br>
  - - - - AnotherGroup1<br>
  - - - - - - - - entity1<br>
  - - - - - - - - entity2<br>
  - - - - AnotherGroup2<br>
  - - - - - - - - entity1<br>
  and so on... </p>
  
  <p>Like I said, I am new to this.  I've also been trying to use this tutorial: </p>
  
  <p><a href="http://blogs.microsoft.co.il/blogs/davids/archive/2009/06/04/hierarchicaldatatemplate-and-treeview.aspx" rel="nofollow noreferrer">http://blogs.microsoft.co.il/blogs/davids/archive/2009/06/04/hierarchicaldatatemplate-and-treeview.aspx</a></p>
  
  <p>but when I try and set another HierarchicalDataTemplate it says that ItemTemplate is set more than once.  I'm lost.  </p>
  
  <hr>
  
  <p>edit:  found this link on the web, it helps, too.... I think...</p>
  
  <p><a href="http://www.codeproject.com/Articles/36451/Organizing-Heterogeneous-Data-on-a-WPF-TreeView.aspx" rel="nofollow noreferrer">http://www.codeproject.com/Articles/36451/Organizing-Heterogeneous-Data-on-a-WPF-TreeView.aspx</a></p>