Basic Library for WPF and Silverlight | ComponentOne
WPF and Silverlight Edition Basic Library / RadialMenu / RadialMenu Features / Checkable Radial Menu Items / Mutually Exclusive Checkable Items
In This Topic
    Mutually Exclusive Checkable Items
    In This Topic

    You can create a group of mutually exclusive checkable items by setting the GroupName property of each item you wish to add to the group. For example, the XAML below will create a group of four mutually exclusive checkable items.

    XAML
    Copy Code
    <Xaml:C1RadialMenu SectorCount="8" >
      <Xaml:C1RadialMenuItem Header="Insert" SectorCount="8" AutoSelect="True" ShowSelectedItem="True" IsCheckable="True" >
      <Xaml:C1RadialMenuItem Header="Insert Left" IsCheckable="True" GroupName="MutuallyExclusiveGroup"/>
      <Xaml:C1RadialMenuItem Header="Insert Above" DisplayIndex="2" IsCheckable="True" GroupName="MutuallyExclusiveGroup"/>
      <Xaml:C1RadialMenuItem Header="Insert Right" DisplayIndex="4" IsCheckable="True" GroupName="MutuallyExclusiveGroup"/>
      <Xaml:C1RadialMenuItem Header="Insert Below" DisplayIndex="6" IsCheckable="True" GroupName="MutuallyExclusiveGroup" />
      </Xaml:C1RadialMenuItem>
    </Xaml:C1RadialMenu>
    

    To create a group of C1RadialMenuItems and only allow one item to be checked at a time, follow these steps:

    1. Add IsCheckable="True" and GroupName="CheckableGroup" to the <Xaml:C1RadialMenuItem> tag of each C1RadialMenuItem you wish to add to the group of mutually exclusive checkable items.
    2. Run the program and click the first item in the group. Observe that the C1RadialMenuItem is highlighted.
    3. Now click the second item in the group and observe that the highlight is removed from the first item and then added to the second item.
    1. Set the Name property of each C1RadialMenuItem you wish to add to the group of mutually exclusive checkable items.
    2. Open the MainPage.xaml.cs page.
    3. Set the IsCheckable and GroupName property of each C1RadialMenuItem, replacing “ItemName” with the value of the C1RadialMenuItem’s Name property.
    Visual Basic
    Copy Code
    ItemName.IsCheckable = True
    

     

    C#
    Copy Code
    ItemName.IsCheckable = true;
    
    1. Run the program and tap the first item in the group and observe the following:
    • Observe that a check that resembles a thinner highlight is added to the C1RadialMenuItem.
    • Now tap the second item in the group and observe that the check is removed from the first item and then added to the second item.