chr
2025-02-24 104cad5ee53eb05d3a89d508a029425726ae89ae
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
31
32
33
<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"
        xmlns:mdi="clr-namespace:WPF.MDI;assembly=WPF.MDI"
        mc:Ignorable="d"
        Loaded="Window_Loaded"
        Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock Text="99999999999999"/>
        <!--停靠布局,让菜单栏和工具栏位于窗口顶部-->
        <mdi:MdiContainer Name="Container" Grid.Row="1">
            <mdi:MdiContainer.Menu>
                <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>
            </mdi:MdiContainer.Menu>
        </mdi:MdiContainer>
    </Grid>
</Window>