The default ItemsPanel
of a TreeView
is a StackPanel
that has the default orientation Vertical
. I have changed the orientation of the StackPanel
to Horizontal
:
<controls:TreeView>
<controls:TreeView.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</controls:TreeView.ItemsPanel>
<controls:TreeViewItem Header="Root" IsExpanded="True">
<controls:TreeViewItem Header="Alfa"/>
<controls:TreeViewItem Header="Beta"/>
<controls:TreeViewItem Header="Gamma"/>
</controls:TreeViewItem>
</controls:TreeView>
I would expect the subordinate items in the tree to stack horizontally instead of vertically, but I see no visible change when I swap the orientation from Vertical
to Horizontal
and back again. Why doesn't the Orientation
of the StackPanel
affect the layout of the items in the ItemsPresenter
?