Basic Library for WPF and Silverlight | ComponentOne
WPF and Silverlight Edition Basic Library / Menu and ContextMenu / Menu and ContextMenu Features / Nested Submenus
In This Topic
    Nested Submenus
    In This Topic

    The C1Menu control and the C1ContextMenu control can hold submenus. These submenus are created when C1MenuItems are nested within the tags of other C1MenuItems. For example, placing the following XAML markup

    XAML
    Copy Code
    <c1:C1MenuItem Header="First">
         <c1:C1MenuItem Header="Second">
              <c1:C1MenuItem Header="Third">
                   <c1:C1MenuItem Header="Fourth">
                        <c1:C1MenuItem Header="Fifth"/>
    </c1:C1MenuItem>
    

     between the opening and closing tags of a C1Menu would create the following:

     

     You can have as many nested menus as you want, although it's best not to have more than two or three submenus in a hierarchy for usability purposes.