How to add stackpanel to menuflyoutitem in UWP?

Viewed 130

I need this type of flyouthow to add stackpanel as menuflyoutitem in UWP? what i have tried is? menuflyoutitem.content=stackpanel;

1 Answers

MenuFlyoutItem does not support complex layouts. If you want to place multiple elements with the help of StackPanel, please use Flyout.

<Flyout x:Name="TestFlyout">
    <StackPanel>
        <!-- other code -->
    </StackPanel>
</Flyout>

Update

If you want to display the picture icon, you can use BitmapIcon:

<MenuFlyout x:Name="TestFlyout">
    <MenuFlyoutItem Text="Merge">
        <MenuFlyoutItem.Icon>
            <BitmapIcon UriSource="ms-appx:///Assets/your_image.png" Width="20" Height="20"/>
        </MenuFlyoutItem.Icon>
    </MenuFlyoutItem>
</MenuFlyout>
Related