tags:

views:

54

answers:

1

we have "layoutstyle" property in Winform to change the layoutstyle to horrizontal/vertical(all heading and Submenus), what is to be used in WPF to get the same result.

A: 

You can give your menu a new ItemsPanelTemplate like this:

<Menu>
    <Menu.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel Orientation="Vertical"/>
        </ItemsPanelTemplate>
    </Menu.ItemsPanel>
    <MenuItem Header="File"/>
    <!-- Other menu items -->
</Menu>

This will layout your menuitems vertically.

Botz3000