diff --git a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml index ad4f759f..9444c0ad 100644 --- a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml +++ b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml @@ -256,6 +256,11 @@ + + + diff --git a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs index 414623be..df239f94 100644 --- a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs @@ -27,6 +27,7 @@ namespace Ink_Canvas.Windows.SettingsViews private bool _wasMaximized = false; private bool _isNavigating = false; + private bool _updateBadgeDismissed = false; public SettingsWindow() { @@ -76,6 +77,7 @@ namespace Ink_Canvas.Windows.SettingsViews SetMaxSizeAndCenter(); RegisterDpiChangedListener(); LoadPluginSettingsPages(); + UpdateUpdateBadgeVisibility(); }; this.Closed += (sender, e) => @@ -290,6 +292,12 @@ namespace Ink_Canvas.Windows.SettingsViews pluginSettingsPage.CurrentPlugin = pluginInfo; } NavigationViewControl.Header = selectedItem.Content; + + if (tag == "UpdatePage") + { + _updateBadgeDismissed = true; + UpdateUpdateBadgeVisibility(); + } } } } @@ -541,5 +549,21 @@ namespace Ink_Canvas.Windows.SettingsViews { return NavigationViewControl; } + + public void UpdateUpdateBadgeVisibility() + { + try + { + var mainWindow = Application.Current.Windows.OfType().FirstOrDefault(); + bool hasUpdate = mainWindow != null && !string.IsNullOrEmpty(mainWindow.AvailableLatestVersion); + var item = FindNavigationViewItemByTag("UpdatePage"); + var badge = item?.InfoBadge; + if (badge != null) + { + badge.Visibility = (hasUpdate && !_updateBadgeDismissed) ? Visibility.Visible : Visibility.Collapsed; + } + } + catch { } + } } }