Version

Adding Separators between XamMenuItems

Separator lines help to distinguish the different options in your xamMenu or xamContextMenu control. Adding a separator requires creating a xamMenuSeparator object and adding it to the items collection.

The following code shows you how to add separators between items in xamMenu.

In XAML:

<ig:XamMenu x:Name="xamMenu1" Height="25">
   <ig:XamMenuItem Header="File">
       <ig:XamMenuItem Header="New" />
       <ig:XamMenuItem Header="Open" />
       <!-- Separator line-->
       <ig:XamMenuSeparator />
       <ig:XamMenuItem Header="Exit" />
   </ig:XamMenuItem>
</ig:XamMenu>

In Visual Basic:

' Add separator
Dim separator1 As New XamMenuSeparator()
parentMenuItem.Items.Add(separator1)

In C#:

// Add separator
XamMenuSeparator separator1 = new XamMenuSeparator();
parentMenuItem.Items.Add(separator1);
SL xamMenu Adding Separators Between Menu Items 01.png