From edd01cc052907e2d732a3b315dfc7b90f7cf24d9 Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Mon, 24 Apr 2023 21:30:56 -0400 Subject: [PATCH] Keep tray icon lock menu option in sync --- Application/NotificationIcon.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Application/NotificationIcon.cs b/Application/NotificationIcon.cs index 9288bb5..9648632 100644 --- a/Application/NotificationIcon.cs +++ b/Application/NotificationIcon.cs @@ -21,6 +21,7 @@ internal static class NotificationIcon // Setup the menu var contextMenu = new ContextMenu(); + contextMenu.Opened += HandleContextMenuOpened; _lockMenuItem = new MenuItem() { @@ -46,6 +47,11 @@ internal static class NotificationIcon _notificationIcon.ForceCreate(false); } + private static void HandleContextMenuOpened(object sender, System.Windows.RoutedEventArgs e) + { + _lockMenuItem.IsChecked = Settings.Default.WindowLocked; + } + private static void HandleNotificationIconDoubleClick(object sender, System.EventArgs e) { // Bring the main form to the front