submenu items in WPF Menu

Vishal picture Vishal · Jul 30, 2009 · Viewed 22.6k times · Source

how to make SUBMENU ites visible vertical as a left navigation in CODEGURU.COM

In windows we use layoutstyle property to make all main and child items to be viewed vertical and DOCK the menustrip to left.

How to acheive this in WPF

Answer

Jobi Joy picture Jobi Joy · Jul 30, 2009

For submenus you can add as many MenuItem nested inside.

<Menu>
  <MenuItem Header="File">
     <MenuItem Header="Open"/>
     <MenuItem Header="Close"/>
  </MenuItem>
  <MenuItem Header="Edit">
     <MenuItem Header="Copy"/>
     <MenuItem Header="Paste"/>
  </MenuItem>
  <MenuItem Header="Options"/>