diff --git a/SudokuSolver/App.xaml.cs b/SudokuSolver/App.xaml.cs index 57a3041..b919046 100644 --- a/SudokuSolver/App.xaml.cs +++ b/SudokuSolver/App.xaml.cs @@ -208,7 +208,7 @@ internal void RegisterWindow(MainWindow window) currentWindow = window; } - internal bool UnRegisterWindow(MainWindow window) + internal void UnRegisterWindow(MainWindow window) { appClosing = windowList.Count == 1; @@ -221,8 +221,6 @@ internal bool UnRegisterWindow(MainWindow window) { currentWindow = windowList.LastOrDefault(); } - - return appClosing; } public int WindowCount => windowList.Count; diff --git a/SudokuSolver/Views/MainWindow.xaml.cs b/SudokuSolver/Views/MainWindow.xaml.cs index 772a6df..0ca2c00 100644 --- a/SudokuSolver/Views/MainWindow.xaml.cs +++ b/SudokuSolver/Views/MainWindow.xaml.cs @@ -208,9 +208,9 @@ private async void Tabs_TabItemsChangedAsync(TabView sender, IVectorChangedEvent AppWindow.Hide(); - bool isLastWindow = App.Instance.UnRegisterWindow(this); + App.Instance.UnRegisterWindow(this); - if (isLastWindow) + if (App.Instance.WindowCount == 0) { await Settings.Data.SaveAsync(); }