Мой макет страницы XAML:
<Window>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="3*"></RowDefinition>
</Grid.RowDefinitions>
<GroupBox Grid.Row="0">
//Controls / Elements
</GroupBox>
<GroupBox Grid.Row="1">
//Controls / Elements
</GroupBox>
</Grid>
</Window>
И я хочу закрепить меню сверху с кодом:
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Header="_New" />
<MenuItem Header="_Open" />
<MenuItem Header="_Save" />
<Separator />
<MenuItem Header="_Exit" />
</MenuItem>
</Menu>
<TextBox AcceptsReturn="True" />
</DockPanel>
Но когда я добавлю его выше <Grid>
, например:
<Window>
<DockPanel>
</DockPanel>
<Grid>
</Grid>
</Window>
выдает ошибку: Property elements cannot be in the middle of an element's content. They must be before or after the content.
Как добавить меню сверху?