How can icons be displayed on menu items?

Platform: .NET MAUI| Category: Controls

MenuFlyoutItem and MenuFlyoutSubItem inherit the IconImageSource property from Menu Item, which enables a small icon to be displayed next to the text for a context menu item. This icon can be an image or a font.

XAML

<Button  Text="&#x25B6;&#xFE0F;Play"
         WidthRequest="80"
         HeightRequest="50">
        <FlyoutBase.ContextFlyout>
            <MenuFlyout>
                <MenuFlyoutItem Text="Pause"
                                Clicked="MenuFlyoutItem_Clicked">
                    <MenuFlyoutItem.IconImageSource>
                        <FontImageSource Glyph="&#x23F8;"
                                         FontFamily="Arial" />
                    </MenuFlyoutItem.IconImageSource>
                </MenuFlyoutItem>
                <MenuFlyoutItem Text="Stop"
                                Clicked="MenuFlyoutItem_Clicked">
                    <MenuFlyoutItem.IconImageSource>
                        <FontImageSource Glyph="&#x23F9;"
                                         FontFamily="Arial" />
                    </MenuFlyoutItem.IconImageSource>
                </MenuFlyoutItem>
            </MenuFlyout>
        </FlyoutBase.ContextFlyout>
</Button>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.