Getting Started with UWP Menu (SfMenu)
25 May 20211 minute to read
This section explains how to create the SfMenu
control.
Adding SfMenu Control
Create a Universal Windows Platform project in Visual Studio and refer to the following assemblies.
- Syncfusion.SfMenu.UWP
- Syncfusion.SfShared.UWP
1.Include the namespace for Syncfusion.SfMenu.UWP assembly in MainPage.xaml
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:menu="using:Syncfusion.UI.Xaml.Controls.Navigation">
2.Now add the SfMenu
control with a required optimal name using the included namespace
<menu:SfMenu x:Name="menu">
Adding SfMenuItems to the Control
Here SfMenuItems
are added as the children of the SfMenu
.
<menu:SfMenu x:Name="menu">
<menu:SfMenuItem Header="Open" />
<menu:SfMenuItem Header="New" />
<menu:SfMenuItem Header="Close" />
<menu:SfMenuItem Header="Add" />
</menu:SfMenu>