WPF menu is not set normally

I happily wrote my new program, and it worked like a charm. It was simple and at first there was no need for a menu until I decided to add more functionality, so a menu was needed. BAAM! The image below explains my problem better.

image

, ? - , , - , . , , . , . - - ? MenuItems - . Unset MenuItems . , "" . "ApplicationCommands.Close".

, Windows 7 x64 WPF Visual Studio 2010. ! !

<Window x:Class="TestDrive.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">
    <Grid>
        <Menu Height="23" HorizontalAlignment="Left" Name="menu1" VerticalAlignment="Top" Width="200">
            <MenuItem Header="File">
                <MenuItem Command="ApplicationCommands.Close" Header="Exit" />
            </MenuItem>
            <MenuItem Header="Edit" />
        </Menu>
    </Grid>
</Window>
+3
2

, , , , .

Windows Touch/TabletPCs, . , , , .

→ → . "". .

EDITED

, DevilFisch Wacom, . pentablet - , , .

+1

, , , . , XAML? :

<Window x:Class="TestDrive.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow">
    <DockPanel>
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="File">
                <MenuItem Command="ApplicationCommands.Close" Header="Exit" />
            </MenuItem>
            <MenuItem Header="Edit" />
        </Menu>
    </DockPanel>
</Window>
+1

Source: https://habr.com/ru/post/1783962/


All Articles