title: WPF Treeview Binding multiple, different Lists
body: <p>I want to bind multiple, different lists to a TreeView in WPF. I looked up some other solutiones but could not find any help for my problem. <a href="https://stackoverflow.com/questions/3673173/wpf-treeview-databinding-hierarchal-data-with-mixed-types">This answer</a> is pretty close but not quite what I am looking for.</p>
  
  <p>I tried the linked solution above but it only displays two levels in the TreeView. <strong>I can't figure out how to show the name of each list as parent in the TreeView.</strong></p>
  
  <p>My object I want to display looks like this:</p>
  
  <pre><code>public class LightDistributor
  {
    public string Description { get; set; }
    // ...
  
    public List&lt;Field&gt; Hardware { get; set; }
    public List&lt;Type&gt; Inputs { get; set; }
    public List&lt;Type&gt; Outputs { get; set; }
  }
  
  public class Field
  {
    public string Fieldname { get; set; }
    // ...
  }
  
  public class Type
  {
    public string TypeDescription { get; set; }
    // ...
  }
  </code></pre>
  
  <p>And the XAML:</p>
  
  <pre><code>&lt;TreeView ItemsSource="{Binding LightDistributors}"&gt;
    &lt;TreeView.ItemTemplate&gt;
      &lt;HierarchicalDataTemplate DataType="{x:Type data:LightDistributor}" ItemsSource="{Binding Hardware}"&gt;
         &lt;TextBlock Text="{Binding Description}" /&gt;
         &lt;HierarchicalDataTemplate.ItemTemplate&gt;
            &lt;DataTemplate DataType="{x:Type data:Field}"&gt;
                 &lt;TextBlock Text="{Binding Description}" /&gt;
            &lt;/DataTemplate&gt;
         &lt;/HierarchicalDataTemplate.ItemTemplate&gt;
      &lt;/HierarchicalDataTemplate&gt;
    &lt;/TreeView.ItemTemplate&gt;   
  &lt;/TreeView&gt;
  </code></pre>
  
  <p>What I want my Treeview to look:</p>
  
  <pre><code>LightDistributor - LongFloor
      | Hardware
          - Field1
          - Field2
          - Field3
      | Inputs
          - InputTypeA
          - InputTypeB
      | Outputs
          - OutputTypeY
          - OutputTypeZ
  </code></pre>
  
  <p>What it currently looks:</p>
  
  <pre><code>LightDistributor - LongFloor
          - Field1
          - Field2
          - Field3
  </code></pre>
  
  <p>Depending on the SelectedItem, a UserControl is displayed with more parameters.</p>