[]
The following quick start guide is intended to get you up and running with the Menu control. In this quick start, you start with creating a new application, adding the Menu control to it and then adding the MenuItems to the Menu control.
![]() |
---|
Declare the namespace using the following code in XAML:
xmlns:c1 ="using:C1.WinUI.Menu"
Place the cursor between the <Grid></Grid> tag and add the following code to create a menu using the C1Menu class, set its orientation and alignment.
<c1:C1Menu x:Name="WordMenu" Orientation="Horizontal" VerticalAlignment="Top"></c1:C1Menu>
Add items to the menu using C1MenuItem class using the following code.
<c1:C1MenuItem Header="File">
<c1:C1MenuItem Header="New">
<c1:C1MenuItem Header="Document"/>
<c1:C1MenuItem Header="Project"/>
</c1:C1MenuItem>
<c1:C1MenuItem Header="Open">
<c1:C1MenuItem Header="Document"/>
<c1:C1MenuItem Header="Project"/>
<c1:C1MenuItem Header="Recent Document 1">
</c1:C1MenuItem>
<c1:C1MenuItem Header="Recent Document 2">
</c1:C1MenuItem>
</c1:C1MenuItem>
<c1:C1MenuItem Header="Close Solution"/>
<c1:C1MenuItem Header="Save"/>
<c1:C1MenuItem Header="Exit"/>
</c1:C1MenuItem>
<c1:C1MenuItem Header="Edit">
<c1:C1MenuItem Header="Undo"/>
<c1:C1MenuItem Header="Redo"/>
</c1:C1MenuItem>
<c1:C1MenuItem Header="Build"/>