RadioMenuFlyoutItem.GroupName Property

Definition

Overloads

GroupName

Gets or sets the name that specifies which RadioMenuFlyoutItem controls are mutually exclusive.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

GroupName

Gets or sets the name that specifies which RadioMenuFlyoutItem controls are mutually exclusive.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

public:
 property Platform::String ^ GroupName { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring GroupName();

void GroupName(winrt::hstring value);
public string GroupName { get; set; }
Public Property GroupName As String

Property Value

String

Platform::String

winrt::hstring

Examples

Radio menu flyout items work in groups, and users can only select one item in a radio menu flyout item group. To create multiple groups of radio buttons within a single menu, be sure to specify the GroupName property of each set.

Two groups of radio menu flyout items within a View menu bar item

<muxc:MenuBar>
    <muxc:MenuBarItem Title="View">
        <MenuFlyoutItem Text="Open"/>
        <MenuFlyoutSeparator/>
        <muxc:RadioMenuFlyoutItem Text="Landscape" GroupName="OrientationGroup"/>
        <muxc:RadioMenuFlyoutItem Text="Portrait" GroupName="OrientationGroup" IsChecked="True"/>
        <MenuFlyoutSeparator/>
        <muxc:RadioMenuFlyoutItem Text="Small icons" GroupName="SizeGroup"/>
        <muxc:RadioMenuFlyoutItem Text="Medium icons" IsChecked="True" GroupName="SizeGroup"/>
        <muxc:RadioMenuFlyoutItem Text="Large icons" GroupName="SizeGroup"/>
    </muxc:MenuBarItem>
</muxc:MenuBar>

Remarks

This property is optional. All RadioMenuFlyoutItems with the default (empty) GroupName will be in the same group.

Applies to