Hello,
Welcome to Microsoft Q&A!
Is this a bug on MenuFlyoutItem?
This is not a bug. I could reproduce this behavior on myside. When you double click on the MenuFlyoutItem
quickly, the Item click event will be triggered and MenuFlyout
will be closed first. Then the second click is actually handled by the host control. That's the reason for this behavior.
A simple way to handle this hehavior is to disable the tap feature of the host control for a short time. When the Menulist is opened, you could set the IsTapEnabled
property of the host control to false. After the Menulist is closed for 2s, make the host control tap enabled again. You could decide the delay time depends on your real scenario.
Here is the code I used. The host control is a RectAngle.
private void MenuList_Opened(object sender, object e)
{
Debug.WriteLine("MenuList_Opened");
MyRect.IsTapEnabled = false;
}
private async void MenuList_Closed(object sender, object e)
{
Debug.WriteLine("MenuList_Closed");
await Task.Delay(2000);
MyRect.IsTapEnabled = true;
}
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.