Search This Blog

Thursday, November 13, 2014

Menu WPF Example

WPF > Controls > Menu

Menu presents a list of items that specify commands or options for an application. Typically, clicking an item on a menu opens a submenu or causes an application execute a command.


Example

<Window x:Class="MapDecision.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <DockPanel>
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="_File">
                <MenuItem Header="_New"/>
                <MenuItem Header="_Open"/>
                <MenuItem Header="_Close"/>
                <MenuItem Header="_Save"/>
            </MenuItem>
        </Menu>
        <StackPanel></StackPanel>
    </DockPanel>
</Window>