Menu allows you to add a separator bar between the menu items to separate each item in the menu. In Menu, these separators are represented by the C1MenuSeparator class. This class represents the MenuSeparator control that is used to separate items in menus by creating a horizontal or vertical line between them based on the orientation of the menu as shown in the following image.
To add a separator bar to a menu, use the following code:
XAML |
コードのコピー
|
---|---|
<c1:C1Menu x:Name="WordMenu" Orientation="Horizontal" AutoClose="False" VerticalAlignment="Top"> <c1:C1MenuItem Header="File"> <c1:C1MenuItem Header="New"> <c1:C1MenuItem Header="Document"/> <c1:C1MenuItem Header="Project"/> </c1:C1MenuItem> <c1:C1MenuSeparator/> <c1:C1MenuItem Header="Open"> <c1:C1MenuItem Header="Document"/> <c1:C1MenuItem Header="Project"/> <c1:C1MenuItem Header="Recent Document 1" GroupName="CheckedDocuments" IsCheckable="True" IsChecked="True"> </c1:C1MenuItem> <c1:C1MenuItem Header="Recent Document 2" Height="Auto" Width="Auto" GroupName="CheckedDocuments" IsCheckable="True"> </c1:C1MenuItem> </c1:C1MenuItem> <c1:C1MenuSeparator/> <c1:C1MenuItem Header="Close Solution"/> <c1:C1MenuItem Header="Save"/> <c1:C1MenuItem Header="Exit"/> </c1:C1MenuItem> <c1:C1MenuSeparator/> <c1:C1MenuItem Header="Edit"> <c1:C1MenuItem Header="Undo"/> <c1:C1MenuItem Header="Redo"/> </c1:C1MenuItem> <c1:C1MenuSeparator/> <c1:C1MenuItem Header="Build"></c1:C1MenuItem> </c1:C1Menu> |