From b75438f6dd69d0815edc505d3e16821dd028ee3d Mon Sep 17 00:00:00 2001 From: zggsong Date: Thu, 18 Jan 2024 18:05:09 +0800 Subject: [PATCH] fix(notifyicon): Fix the issue of the context menu of the tray program not dynamically refreshing the theme. --- STranslate/Views/NotifyIcon.xaml | 12 +++++++++--- STranslate/Views/NotifyIcon.xaml.cs | 13 ++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/STranslate/Views/NotifyIcon.xaml b/STranslate/Views/NotifyIcon.xaml index 9fae5363..dbd35d67 100644 --- a/STranslate/Views/NotifyIcon.xaml +++ b/STranslate/Views/NotifyIcon.xaml @@ -16,13 +16,19 @@ - + ToolTipText="{Binding NIModel.ToolTip}" + TrayContextMenuOpen="TrayIcon_TrayContextMenuOpen"> - + + /// https://github.com/hardcodet/wpf-notifyicon/issues/19 + /// + /// + /// + private void TrayIcon_TrayContextMenuOpen(object sender, RoutedEventArgs e) + { + TrayIconContextMenu.UpdateDefaultStyle(); + } } }