From fe84ef698fe4a7b635a491fa641298cb1eb312e1 Mon Sep 17 00:00:00 2001 From: Jimmy White Date: Mon, 27 Nov 2023 09:54:38 +0000 Subject: [PATCH] Added some form close logic to subforms --- HA-Game-SPy/GameAddWindow.xaml.cs | 1 + HA-Game-SPy/GameListWindow.xaml.cs | 1 + HA-Game-SPy/HA-Game-SPy.csproj | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/HA-Game-SPy/GameAddWindow.xaml.cs b/HA-Game-SPy/GameAddWindow.xaml.cs index dbfced9..96b2161 100644 --- a/HA-Game-SPy/GameAddWindow.xaml.cs +++ b/HA-Game-SPy/GameAddWindow.xaml.cs @@ -74,6 +74,7 @@ private async Task SaveGamesAsync(List games) string json = JsonConvert.SerializeObject(games, Formatting.Indented); // Using Formatting.Indented for readability await File.WriteAllTextAsync(gamesFilePath, json); + this.Close(); // Close the window after saving } #endregion Private Methods diff --git a/HA-Game-SPy/GameListWindow.xaml.cs b/HA-Game-SPy/GameListWindow.xaml.cs index 09e5885..924173c 100644 --- a/HA-Game-SPy/GameListWindow.xaml.cs +++ b/HA-Game-SPy/GameListWindow.xaml.cs @@ -80,6 +80,7 @@ private async Task SaveGamesAsync(List games) string json = JsonConvert.SerializeObject(validGames, Formatting.Indented); // Serialize the valid games into JSON await File.WriteAllTextAsync(gamesFilePath, json); // Write the JSON to the file + this.Close(); // Close the window after saving } diff --git a/HA-Game-SPy/HA-Game-SPy.csproj b/HA-Game-SPy/HA-Game-SPy.csproj index 59edba4..a1178d4 100644 --- a/HA-Game-SPy/HA-Game-SPy.csproj +++ b/HA-Game-SPy/HA-Game-SPy.csproj @@ -6,8 +6,8 @@ HA_Game_SPy enable true - 1.0.0.104 - 1.0.0.104 + 1.0.0.106 + 1.0.0.106 trans.ico download.png