-
-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
I would like to keep the Flyout open if we click a MenuFlyoutItem, and only close with light dismiss.
I have done this in the past in a regular WinUI 3 project with args.Cancel = true; in Closing="MyMenuFlyout_Closing" (see below) but in this case MyMenuFlyout_Closing is not being called
How can this be done?
<notifyIcon:TaskbarIcon
x:Name="TrayIconFoo"
ContextMenuMode="SecondWindow"
NoLeftClickDelay="True"
ToolTipText="Foo me ToolTip">
<notifyIcon:TaskbarIcon.IconSource>
<notifyIcon:GeneratedIconSource Foreground="DarkSeaGreen" Text="❤️" />
</notifyIcon:TaskbarIcon.IconSource>
<notifyIcon:TaskbarIcon.ContextFlyout>
<MenuFlyout x:Name="MyMenuFlyout" Closing="MyMenuFlyout_Closing">
<MenuFlyoutItem Command="{x:Bind DoSomethingCommand}" Text="Test command" />
<MenuFlyoutItem Text="Test" />
</MenuFlyout>
</notifyIcon:TaskbarIcon.ContextFlyout>
</notifyIcon:TaskbarIcon>```
private void MyMenuFlyout_Closing(FlyoutBase sender, FlyoutBaseClosingEventArgs args)
{
Debug.WriteLine($"Flyout Closing called..."); // <<<< not being called
args.Cancel = true; // Usually prevents the flyout from closing
}
Metadata
Metadata
Assignees
Labels
No labels