title: TreeView nodes not being displayed
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6004356/xaml-code-for-treeview">XAML Code for TREEVIEW</a>  </p>
  </blockquote>
  
  
  
  <p>Following is the code for TreeView in XAML:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;TreeView Height="338" HorizontalAlignment="Left" Margin="6,6,0,0"
            Name="DisksTreeView1" VerticalAlignment="Top" Width="293"&gt;
      &lt;TreeView.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;StackPanel Orientation="Horizontal"&gt;
                  &lt;Image Source="{Binding ImagePath}" Width="32" Height="32"/&gt;
                  &lt;TextBlock Text="{Binding Namee}"/&gt;
              &lt;/StackPanel&gt;
          &lt;/DataTemplate&gt;
      &lt;/TreeView.ItemTemplate&gt;
  &lt;/TreeView&gt;
  </code></pre>
  
  <p>And following is the code behind:</p>
  
  <pre><code>Dim adpt As New DatabaseDearDataSetTableAdapters.DiskListTableAdapter
  For Each k As KeyValuePair(Of String, GenreSet) In GenreSetDictionary
      Dim t As New TreeNodeSet
      t.Genre = True
      t.Imagepath = k.Value.IconPath
      t.Namee = k.Key
      Dim pnode As New TreeViewItem
      pnode.DataContext = t
      For Each z As DatabaseDearDataSet.DiskListRow In adpt.GetDataByGenre(t.Namee)
          Dim tt As New TreeNodeSet
          tt.Genre = False
          tt.Imagepath = IconDictionary(z.DiskIcon).IconPath
          tt.Namee = z.DiskName
          Dim cnode As New TreeViewItem
          cnode.DataContext = tt
          pnode.Items.Add(cnode)
      Next
      DisksTreeView1.Items.Add(pnode)
  Next
  </code></pre>
  
  <p>I am able to get the <code>pnode</code> added to the TreeView and all the node breakpoints are hit.  The problem is that in the TreeView, I am only able to see the parent view arrow, the rest of the name, image, etc. are not getting displayed. It is like this:</p>
  
  <p><a href="https://imageshack.com/" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sX2vA.jpg" alt="Sample picture"></a>
  </p>
  
  <p>How can I fix this?</p>