How to add Submenus in a Menu
Just redefine the ItemsPanel
:
<Menu> <Menu.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical"/> </ItemsPanelTemplate> </Menu.ItemsPanel> <MenuItem Header="Foo"/> <MenuItem Header="Bar"/> <MenuItem Header="Baz"/> ...</Menu>
Note that this will not get rid of the vertical gradient effect in Vista/Win7 menus. If you want that, set Menu.Background
property to whatever you want (could even be Transparent
).