Basic Library for WPF and Silverlight | ComponentOne
WPF and Silverlight Edition Basic Library / Menu and ContextMenu / Menu and ContextMenu Quick Start / Step 2 of 5: Adding Menu Items
In This Topic
    Step 2 of 5: Adding Menu Items
    In This Topic

    In the last step, you created a Silverlight project with a C1Menu control attached to it. In this step, you will add three menu items to the C1Menu control.

    1. Add three C1MenuItems to your C1Menu control. You can do this by editing the control's markup so that it resembles the following:
    XAML
    Copy Code
    <c1:C1Menu HorizontalAlignment="Left" VerticalAlignment="Top" Height="Auto" Width="Auto">
         <c1:C1MenuItem></c1:C1MenuItem>
         <c1:C1MenuItem></c1:C1MenuItem>
         <c1:C1MenuItem></c1:C1MenuItem>
    </c1:C1Menu>
    
    1. Select the first C1MenuItem you added and edit the markup so that it resembles the following:
    XAML
    Copy Code
    <c1:C1MenuItem Height="Auto" Width="Auto" Header="File"></c1:C1MenuItem>
    
    1. Select the second C1MenuItem you added and edit the markup so that it resembles the following:
    XAML
    Copy Code
    <c1:C1MenuItem Height="Auto" Width="Auto" Header="Edit"></c1:C1MenuItem>
    
    1. Select the third C1MenuItem and edit the markup so that it resembles the following:
    XAML
    Copy Code
    <c1:C1MenuItem Height="Auto" Width="Auto" Header="Added Items"></c1:C1MenuItem>
    

    In this step, you added top-level menu items to the C1Menu control. In the next step, you will use XAML to add submenus to two of those items.