Menu and Content not working.
I'm new to WPF. I've just been trying to put a menu bar and a grid object in a window, but I always get the exception that I am trying to set a content property more than once. I can't figure out how to put a menu along with other elements in the window.
Code:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Eliptical Button">
<Menu IsMainMenu="True">
<MenuItem Header="File">
<MenuItem Header="New"/>
<Separator/>
<MenuItem Header="Open"/>
<MenuItem Header="Save"/>
<Separator/>
<MenuItem Header="Save As..."/>
<Separator/>
<MenuItem Header="Exit"/>
</MenuItem>
<MenuItem Header="Edit"/>
</Menu>
<Grid>
<Button/>
</Grid>
</Window>
Can someone please help me to get this right? Thanks.
Re: Menu and Content not working.
you must put the menu and the grid with the button (or just the button) in a single main grid so the main window will have only one child