title: WPF: HierarchicalDataTemplate ItemsPanel
body: <p>I have a ``TreeView<code>which uses a custom</code>ItemsPanel<code>to show the first level of items in a</code>StackPanel<code>, but I need to show subitems in a</code>StackPanel<code>too. The problem is, the second level of items are shown in a</code>WrapPanel<code>, and as</code>HierarchicalDataTemplate<code>doesn't have an</code>ItemsPanel` property I'm not sure how to do this. This is my xaml:</p>
  
  <pre><code>&lt;TreeView x:Name="treGlobalCards"&gt;
      &lt;TreeView.ItemsPanel&gt;
          &lt;ItemsPanelTemplate&gt;
              &lt;StackPanel IsItemsHost="True" Orientation="{Binding Orientation,RelativeSource={x:Static RelativeSource.TemplatedParent}}"
                          MaxWidth="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType={x:Type ScrollContentPresenter}}}"/&gt;
          &lt;/ItemsPanelTemplate&gt;
      &lt;/TreeView.ItemsPanel&gt;
      &lt;TreeView.ItemTemplate&gt;
      &lt;HierarchicalDataTemplate x:Key="CardTypeTemplate" ItemsSource="{Binding Cards}"&gt;
          &lt;TextBlock Text="{Binding Path=CardType}"/&gt;
      &lt;/HierarchicalDataTemplate&gt;
      &lt;/TreeView.ItemTemplate&gt;
  &lt;/TreeView&gt;
  </code></pre>