WPF and Silverlight Edition Basic Library / Menu and ContextMenu / Menu and ContextMenu Elements / Creating Menus
Creating Menus

Complete the following steps:

  1. Add a C1Menu or C1ContextMenu to your application.
  2. Place the following XAML between the <c1:C1Menu> and </c1:C1Menu> tags or the <c1:C1ContextMenu> and </c1:C1ContextMenu> tags.
XAML
Copy Code
<c1:C1MenuItem Header="MenuItem1" Height="Auto" Width="Auto"/>
<c1:C1MenuItem Header="MenuItem2" Height="Auto" Width="Auto"/>
<c1:C1MenuItem Header="MenuItem3" Height="Auto" Width="Auto"/>
  1. Add Height="Auto" and Width="Auto" to the <c1:C1Menu> or <c1:C1ContextMenu> tag.
  2. Run the program and complete one of the following:
  • If you are using a C1Menu control, observe that a menu bar with three items appears.

OR

  • If you are using a C1ContextMenu control, right-click the element the context menu is attached to. Observe that a menu with three items appears.