title: wpf treeview with custom class
body: <p>I want to show datas in Treeview like this :(*1)</p>
  
  <pre><code> - There are 2 tickets 
     -- Opening problem category with ID 5685
     -- Closing problem category with ID 5687
   - There are 3 projects
     -- WPF project with ID 1234
     -- C# project with ID 12345
     -- ASP.NET project with ID 12
  </code></pre>
  
  <p><code>Tickets</code>, <code>Projects</code> classes inherited from <code>EntityBase</code> class</p>
  
  <pre><code>public class EntityBase
      {
          public int EntityID { get; set; }
          public static EntityCollection entityCollection { get; set; }
          public EntityBase() 
          {
              entityCollection = new EntityCollection();
          }
      }
  </code></pre>
  
  <p>EntityCollection has private <code>List&lt;EntityBase&gt;</code> data.</p>
  
  <p>To make parent nodes of projects or tickets, I created <code>TreeViewParentNode</code> class</p>
  
  <pre><code>    public class TreeViewParentNode
          {
              public string ParentName { get; set; }
              public List&lt;EntityBase&gt; ParentItems;
              public int ParentCount;
              public TreeViewParentNode(string ParentName) 
              {
                  ParentCount = 0;
                  this.ParentName = ParentName;
                  ParentItems = new List&lt;EntityBase&gt;();
              }
   }
  </code></pre>
  
  <p>I have created a collection to show data in <code>Treeview</code> <code>ObservableCollection&lt;TreeViewParentNode&gt;</code> 
  The Window's constructor:</p>
  
  <pre><code> public ReminderExtendedWindow()
          {
              InitializeComponent();
              this.ResizeMode = ResizeMode.NoResize;
              List&lt;TreeViewParentNode&gt; Nodes = new List&lt;TreeViewParentNode&gt;();
              foreach (EntityBase EntityItem in EntityBase.entityCollection)
              {
                 TreeViewParentNode findnode = Nodes.Find(
                     delegate(TreeViewParentNode node) 
                     { 
                         return node.ParentName == EntityItem.GetType().Name; 
                     }
                     );
                 if (findnode == null)
                 {
                     TreeViewParentNode NewParentNode = new TreeViewParentNode(EntityItem.GetType().Name);
                     NewParentNode.ParentItems.Add(EntityItem);
                     NewParentNode.ParentCount++;
                     Nodes.Add(NewParentNode);
                 }
                 else
                 {
                     findnode.ParentItems.Add(EntityItem);
                     findnode.ParentCount++;
                 }
              }
              Coll = new ObservableCollection&lt;TreeViewParentNode&gt;(Nodes);
              DataContext = this;
  
          }   
  </code></pre>
  
  <p>Treeview <strong>XAML</strong> codes</p>
  
  <pre><code>&lt;TreeView Height="500" Width="375" Background="Transparent" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,50,0,0" 
                 BorderThickness="0,0,0,0" x:Name="EntityTree" ItemsSource="{Binding Coll}"&gt;
  </code></pre>
  
  <p>What should I do to display datas like showed in above(*1) ? </p>