Skip to content

Latest commit

 

History

History
58 lines (39 loc) · 3.65 KB

radiomenuflyoutitem.md

File metadata and controls

58 lines (39 loc) · 3.65 KB
-api-id -api-type
T:Microsoft.UI.Xaml.Controls.RadioMenuFlyoutItem
winrt class

Microsoft.UI.Xaml.Controls.RadioMenuFlyoutItem

-description

Represents a menu item that is mutually exclusive with other radio menu items in its group.

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

-remarks

This control allows you to present users with menus containing multiple options, where a user would choose only one of these options at a given time.

RadioMenuFlyoutItem can be used inside MenuBarItem, MenuFlyout and MenuFlyoutSubItem.

Control style and template

You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about modifying a control's style and template, see XAML styles. XAML also includes resources that you can use to modify the colors of a control in different visual states without modifying the control template. Modifying these resources is preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling section of the XAML styles article.

The resources for this control are listed in the ThemeDictionaries section of the RadioMenuFlyoutItem_themeresources.xaml file on GitHub. The ResourceKey value for each StaticResource references a brush and color in the Common_themeresources_any.xaml file.

-see-also

Creating a menu

-examples

Tip

For more info, design guidance, and code examples, see Menu flyout and menu bar.

[!div class="nextstepaction"] Open the WinUI 2 Gallery app and see the MenuFlyout in action.

The WinUI 2 Gallery app includes interactive examples of most WinUI 2 controls, features, and functionality. Get the app from the Microsoft Store or get the source code on GitHub.

This example shows how to create a three item radio menu flyout experience.

<Button Content="Options">
    <Button.Flyout>
        <MenuFlyout>
            <MenuFlyoutSubItem Text="View">
                <muxc:RadioMenuFlyoutItem Text="Small icons" GroupName="ViewGroup"/>
                <muxc:RadioMenuFlyoutItem Text="Medium icons" GroupName="ViewGroup" IsChecked="True"/>
                <muxc:RadioMenuFlyoutItem Text="Large icons" GroupName="ViewGroup"/>
            </MenuFlyoutSubItem>
        </MenuFlyout>
    </Button.Flyout>
</Button>