diff --git a/src/Starward/Features/GameLauncher/GameBannerAndPost.xaml.cs b/src/Starward/Features/GameLauncher/GameBannerAndPost.xaml.cs index 5a0940309..c889f1b13 100644 --- a/src/Starward/Features/GameLauncher/GameBannerAndPost.xaml.cs +++ b/src/Starward/Features/GameLauncher/GameBannerAndPost.xaml.cs @@ -71,6 +71,9 @@ private void GameBannerAndPost_Unloaded(object sender, RoutedEventArgs e) { WeakReferenceMessenger.Default.UnregisterAll(this); _bannerTimer.Stop(); + _bannerTimer.Tick -= _bannerTimer_Tick; + Banners = null; + PostGroups = null; } @@ -201,7 +204,14 @@ private async Task UpdateGameNoticeAlertAsync() Button_InGameNotices.Visibility = Visibility.Collapsed; return; } - IsGameNoticesAlert = await _gameNoticeService.IsNoticeAlertAsync(CurrentGameId.GameBiz); + if (AppSetting.DisableGameNoticeRedHot) + { + IsGameNoticesAlert = false; + } + else + { + IsGameNoticesAlert = await _gameNoticeService.IsNoticeAlertAsync(CurrentGameId.GameBiz); + } } catch (Exception ex) { diff --git a/src/Starward/Features/GameLauncher/GameLauncherSettingDialog.xaml b/src/Starward/Features/GameLauncher/GameLauncherSettingDialog.xaml index 8a1a89c35..582227282 100644 --- a/src/Starward/Features/GameLauncher/GameLauncherSettingDialog.xaml +++ b/src/Starward/Features/GameLauncher/GameLauncherSettingDialog.xaml @@ -164,11 +164,6 @@ - diff --git a/src/Starward/Features/GameLauncher/GameLauncherSettingDialog.xaml.cs b/src/Starward/Features/GameLauncher/GameLauncherSettingDialog.xaml.cs index d3448c5b7..40c8509c8 100644 --- a/src/Starward/Features/GameLauncher/GameLauncherSettingDialog.xaml.cs +++ b/src/Starward/Features/GameLauncher/GameLauncherSettingDialog.xaml.cs @@ -50,6 +50,7 @@ public GameLauncherSettingDialog() { this.InitializeComponent(); this.Loaded += GameLauncherSettingDialog_Loaded; + this.Unloaded += GameLauncherSettingDialog_Unloaded; } @@ -93,7 +94,6 @@ private void FlipView_Settings_Loaded(object sender, RoutedEventArgs e) - private void NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args) { try @@ -133,6 +133,14 @@ private async void GameLauncherSettingDialog_Loaded(object sender, RoutedEventAr } + private void GameLauncherSettingDialog_Unloaded(object sender, RoutedEventArgs e) + { + LatestPackageGroups = null!; + PreInstallPackageGroups = null!; + FlipView_Settings.Items.Clear(); + } + + [RelayCommand] diff --git a/src/Starward/Features/GameRecord/BattleChronicleWindow.xaml.cs b/src/Starward/Features/GameRecord/BattleChronicleWindow.xaml.cs index 9efed6345..e87374d07 100644 --- a/src/Starward/Features/GameRecord/BattleChronicleWindow.xaml.cs +++ b/src/Starward/Features/GameRecord/BattleChronicleWindow.xaml.cs @@ -59,6 +59,7 @@ private void CenterInScreen() private void RootGrid_Loaded(object sender, RoutedEventArgs e) { + RootGrid.Loaded -= RootGrid_Loaded; _ = bbsWebBridge.LoadPageAsync(); } diff --git a/src/Starward/Features/GameRecord/GameRecordPage.xaml.cs b/src/Starward/Features/GameRecord/GameRecordPage.xaml.cs index 72551d7b3..f9e799dcb 100644 --- a/src/Starward/Features/GameRecord/GameRecordPage.xaml.cs +++ b/src/Starward/Features/GameRecord/GameRecordPage.xaml.cs @@ -96,6 +96,10 @@ protected override async void OnLoaded() protected override void OnUnloaded() { WeakReferenceMessenger.Default.UnregisterAll(this); + NavigationViewItem_BattleChronicle.Tapped -= NavigationViewItem_BattleChronicle_Tapped; + NavigationViewItem_UpdateDeviceInfo.Tapped -= NavigationViewItem_UpdateDeviceInfo_Tapped; + CurrentRole = null; + GameRoleList = null!; } @@ -252,7 +256,8 @@ private void InitializeNavigationViewItemVisibility() public GameRecordRole? CurrentRole { - get; set + get; + set { if (SetProperty(ref field, value)) { diff --git a/src/Starward/Features/GameRecord/Genshin/ImaginariumTheaterPage.xaml.cs b/src/Starward/Features/GameRecord/Genshin/ImaginariumTheaterPage.xaml.cs index 9d1a96f13..920d853bc 100644 --- a/src/Starward/Features/GameRecord/Genshin/ImaginariumTheaterPage.xaml.cs +++ b/src/Starward/Features/GameRecord/Genshin/ImaginariumTheaterPage.xaml.cs @@ -56,6 +56,14 @@ protected override async void OnLoaded() + protected override void OnUnloaded() + { + CurrentTheater = null; + TheaterList = null!; + } + + + [ObservableProperty] private bool hasData; diff --git a/src/Starward/Features/GameRecord/Genshin/SpiralAbyssPage.xaml.cs b/src/Starward/Features/GameRecord/Genshin/SpiralAbyssPage.xaml.cs index 86d265e6d..e6a01655a 100644 --- a/src/Starward/Features/GameRecord/Genshin/SpiralAbyssPage.xaml.cs +++ b/src/Starward/Features/GameRecord/Genshin/SpiralAbyssPage.xaml.cs @@ -55,6 +55,12 @@ protected override async void OnLoaded() + protected override void OnUnloaded() + { + CurrentAbyss = null; + AbyssList = null!; + } + [ObservableProperty] diff --git a/src/Starward/Features/GameRecord/Genshin/TravelersDiaryPage.xaml.cs b/src/Starward/Features/GameRecord/Genshin/TravelersDiaryPage.xaml.cs index dec042de7..47d0bcfd7 100644 --- a/src/Starward/Features/GameRecord/Genshin/TravelersDiaryPage.xaml.cs +++ b/src/Starward/Features/GameRecord/Genshin/TravelersDiaryPage.xaml.cs @@ -56,6 +56,16 @@ protected override async void OnLoaded() } + protected override void OnUnloaded() + { + CurrentSummary = null!; + SelectMonthData = null; + MonthDataList = null!; + CurrentSeries = null; + SelectSeries = null; + DayDataList = null!; + } + [ObservableProperty] diff --git a/src/Starward/Features/GameRecord/StarRail/ApocalypticShadowPage.xaml.cs b/src/Starward/Features/GameRecord/StarRail/ApocalypticShadowPage.xaml.cs index e88da1228..844e0b51f 100644 --- a/src/Starward/Features/GameRecord/StarRail/ApocalypticShadowPage.xaml.cs +++ b/src/Starward/Features/GameRecord/StarRail/ApocalypticShadowPage.xaml.cs @@ -56,6 +56,13 @@ protected override async void OnLoaded() + protected override void OnUnloaded() + { + CurrentApocalypticShadow = null; + ApocalypticShadowList = null!; + } + + [ObservableProperty] private List apocalypticShadowList; diff --git a/src/Starward/Features/GameRecord/StarRail/ForgottenHallPage.xaml.cs b/src/Starward/Features/GameRecord/StarRail/ForgottenHallPage.xaml.cs index 5457f1993..167572dee 100644 --- a/src/Starward/Features/GameRecord/StarRail/ForgottenHallPage.xaml.cs +++ b/src/Starward/Features/GameRecord/StarRail/ForgottenHallPage.xaml.cs @@ -56,6 +56,13 @@ protected override async void OnLoaded() + protected override void OnUnloaded() + { + CurrentForgottenHall = null; + ForgottenHallList = null!; + } + + [ObservableProperty] private List forgottenHallList; diff --git a/src/Starward/Features/GameRecord/StarRail/PureFictionPage.xaml.cs b/src/Starward/Features/GameRecord/StarRail/PureFictionPage.xaml.cs index 599cdd616..8ea3e8d6e 100644 --- a/src/Starward/Features/GameRecord/StarRail/PureFictionPage.xaml.cs +++ b/src/Starward/Features/GameRecord/StarRail/PureFictionPage.xaml.cs @@ -56,6 +56,13 @@ protected override async void OnLoaded() + protected override void OnUnloaded() + { + CurrentPureFiction = null; + PureFictionList = null!; + } + + [ObservableProperty] private List pureFictionList; diff --git a/src/Starward/Features/GameRecord/StarRail/SimulatedUniversePage.xaml.cs b/src/Starward/Features/GameRecord/StarRail/SimulatedUniversePage.xaml.cs index 8cbeaae45..e46de14f3 100644 --- a/src/Starward/Features/GameRecord/StarRail/SimulatedUniversePage.xaml.cs +++ b/src/Starward/Features/GameRecord/StarRail/SimulatedUniversePage.xaml.cs @@ -55,6 +55,14 @@ protected override async void OnLoaded() + protected override void OnUnloaded() + { + BasicInfo = null!; + CurrentRecord = null; + RecordBasicList = null!; + } + + [ObservableProperty] private SimulatedUniverseBasicStats basicInfo; diff --git a/src/Starward/Features/GameRecord/StarRail/TrailblazeCalendarPage.xaml.cs b/src/Starward/Features/GameRecord/StarRail/TrailblazeCalendarPage.xaml.cs index 433b80da3..7f340dd24 100644 --- a/src/Starward/Features/GameRecord/StarRail/TrailblazeCalendarPage.xaml.cs +++ b/src/Starward/Features/GameRecord/StarRail/TrailblazeCalendarPage.xaml.cs @@ -57,6 +57,18 @@ protected override async void OnLoaded() + protected override void OnUnloaded() + { + CurrentSummary = null!; + SelectMonthData = null; + MonthDataList = null!; + CurrentSeries = null; + SelectSeries = null; + DayDataList = null!; + } + + + [ObservableProperty] private TrailblazeCalendarSummary currentSummary; diff --git a/src/Starward/Features/GameRecord/ZZZ/InterKnotMonthlyReportPage.xaml.cs b/src/Starward/Features/GameRecord/ZZZ/InterKnotMonthlyReportPage.xaml.cs index c6bef9daf..807c76b5c 100644 --- a/src/Starward/Features/GameRecord/ZZZ/InterKnotMonthlyReportPage.xaml.cs +++ b/src/Starward/Features/GameRecord/ZZZ/InterKnotMonthlyReportPage.xaml.cs @@ -59,6 +59,18 @@ protected override async void OnLoaded() + protected override void OnUnloaded() + { + base.OnUnloaded(); + CurrentSummary = null!; + SelectMonthData = null; + MonthDataList = null!; + CurrentSeries = null!; + SelectSeries = null!; + DayDataList = null!; + } + + [ObservableProperty] private InterKnotReportSummary currentSummary; diff --git a/src/Starward/Features/Screenshot/ImageViewWindow.xaml b/src/Starward/Features/Screenshot/ImageViewWindow.xaml index 7a1a7b98c..085e75c46 100644 --- a/src/Starward/Features/Screenshot/ImageViewWindow.xaml +++ b/src/Starward/Features/Screenshot/ImageViewWindow.xaml @@ -108,7 +108,8 @@ - -