From f9286e106f7103f52590586def606210a5c23fce Mon Sep 17 00:00:00 2001 From: Howon Lee Date: Thu, 15 Aug 2024 18:23:54 +0900 Subject: [PATCH] Fix the issue of #161 --- .../TaskbarIcon.ContextMenu.WinUI.SecondWindow.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/libs/H.NotifyIcon.Shared/TaskbarIcon.ContextMenu.WinUI.SecondWindow.cs b/src/libs/H.NotifyIcon.Shared/TaskbarIcon.ContextMenu.WinUI.SecondWindow.cs index 8682d46..44de719 100644 --- a/src/libs/H.NotifyIcon.Shared/TaskbarIcon.ContextMenu.WinUI.SecondWindow.cs +++ b/src/libs/H.NotifyIcon.Shared/TaskbarIcon.ContextMenu.WinUI.SecondWindow.cs @@ -122,12 +122,17 @@ private void PrepareContextMenuWindow() flyoutItemBase.Padding = new Thickness(11, 0, 11, 0); } flyout.Items.Add(flyoutItemBase); - flyoutItemBase.Tapped += (_, _) => + + // MenuFlyoutSubItem should not be clickable and should not close the context menu + if (flyoutItemBase is not MenuFlyoutSubItem) { - IsContextMenuVisible = false; - flyout.Hide(); - _ = WindowUtilities.HideWindow(handle); - }; + flyoutItemBase.Tapped += (_, _) => + { + IsContextMenuVisible = false; + flyout.Hide(); + _ = WindowUtilities.HideWindow(handle); + }; + } } frame.Loaded += (_, _) =>