alielie
2025-11-25 006c98e5650b530e5220f279c1e803fefe69d40d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<Window x:Class="WPFProject.UI.WorkWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WPFProject.UI"
        mc:Ignorable="d"
        Loaded="Window_Loaded"
        Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock Text="99999999999999"/>
        <!--停靠布局,让菜单栏和工具栏位于窗口顶部-->
        <Grid Name="Container" Grid.Row="1">
            <Menu DockPanel.Dock="Top">
                <MenuItem Header="文件">
                    <!--菜单项为MenuItem,文字使用属性 Header-->
                    <MenuItem Name="newFile" Header="新建"></MenuItem>
 
                </MenuItem>
                <MenuItem Header="节点"></MenuItem>
                <MenuItem Header="窗口" x:Name="WindowsMenu" x:FieldModifier="private" />
                <MenuItem Header="关于"></MenuItem>
            </Menu>
        </Grid>
    </Grid>
</Window>