title: Linq query to treeview HierarchicalDataTemplate
body: <p>First, sorry for my bad english.
  I have an EF entity that looks like:</p>
  
  <pre><code>class Item
  {    
      public Guid Id { get; set; }
      public string Title{ get; set; }
      public Guid? ParentId { get; set; }
      public ICollection&lt;Item&gt; Items { get; set; }    
  }</code></pre>
  
  <p>Now i want to load the data from that entity on a treeview... the best I could get is the follow xaml:</p>
  
  <pre><code>&lt;TreeView Name="treeItems"&gt;
      &lt;TreeView.ItemTemplate&gt;
          &lt;HierarchicalDataTemplate DataType="{x:Type local:Item}" ItemsSource="{Binding Items}"&gt;
              &lt;TextBlock  Text="{Binding Path=Title}" /&gt;
          &lt;/HierarchicalDataTemplate&gt;
      &lt;/TreeView.ItemTemplate&gt;
  &lt;/TreeView&gt;
  </code></pre>
  
  <p>and load the data with </p>
  
  <pre><code>var itens = from it in ctx.Item select it;
  treeItems.ItemsSource = itens;
  </code></pre>
  
  <p>This obviously displays the data on the treeview like this:</p>
  
  <pre>
  ItemA
    ItemA1
    ItemA2
  ItemA1 --repeated node
  ItemA2 --repeated node
  </pre>
  
  <p>How can i tweak (or rewrite) my code so the treeview displays the data in hierarchical way, without the repeated nodes?</p>