RadioMenuFlyoutItem.GroupName Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.
<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.