Basic Library for WPF and Silverlight | ComponentOne
WPF and Silverlight Edition Basic Library / RadialMenu / RadialMenu Features / Automatic Collapsing
In This Topic
    Automatic Collapsing
    In This Topic

    The Automatic Collapsing feature provides users a way to collapse or close the C1RadialMenu control from its opened state. The only way available with the users to close the radial menu is by clicking the Navigation Button. However, the automatic collapsing feature enables users in closing a radial menu by clicking anywhere outside the control's boundaries. 

    The AutoCollapse property of the C1RadialMenu class enables automatic collapsing of the radial menu control. You can set the AutoCollapse property True, which allows users to close a radial menu by clicking anywhere outside the control's boundaries. To disable this behavior, you can set the AutoCollapse property False. By default, the AutoCollapse property is set True.

    1. Add AutoCollapse="True" to the <C1RadialMenu> tag.
    2. Run the program.
    1. In Source view locate, the <C1RadialMenuItem> tag for the item you wish to make checkable and add Name="C1RadialMenu1" to it. This will give the item a unique identifier that you can use in code.
    2. Enter Code view and add the following code beneath the InitializeComponent() method:
    Visual Basic
    Copy Code
    C1RadialMenu1.AutoCollapse = True
    

    C#
    Copy Code
    C1RadialMenu1.AutoCollapse = true;
    
    1. Run the program.

    After you run the project, right-click the page to view the C1RadialMenu control. With the radial menu open, click anywhere outside the menu and observe that the radial menu control closes.

    Collapsing RadialMenu By Clicking Child RadialMenuItems

    The C1RadialMenu also provides automatic collapsing on clicking the child radial menu items having no item in it. To enable this behavior, you need to set the CollapseOnClick property True.

    1. Add ClickOnCollapse="True" to the <C1RadialMenuItem> tag.
    2. Run the program.
    1. Switch to the code view and add the following code below the InitializeComponent() method:
    Visual Basic
    Copy Code
    C1RadialMenuItem1.ClickOnCollapse = True
    

    C#
    Copy Code
    C1RadialMenuItem1.ClickOnCollapse = true;