diff --git a/UI/ViewModels/MainWindowViewModel.cs b/UI/ViewModels/MainWindowViewModel.cs index de1e842..6983a05 100644 --- a/UI/ViewModels/MainWindowViewModel.cs +++ b/UI/ViewModels/MainWindowViewModel.cs @@ -217,7 +217,14 @@ public partial class MainWindowViewModel : ViewModelBase if (this.UnsavedChanges) { var userWantsToSave = await this._dialogService.ShowDialog(new UnsavedChangesDialog()); - if (userWantsToSave is null) return; + switch (userWantsToSave) + { + case null: + return; + case true: + this.StartTagSaveCommand.Execute(null); + break; + } } var storageProvider = desktop.MainWindow?.StorageProvider; @@ -250,10 +257,16 @@ public partial class MainWindowViewModel : ViewModelBase if (this.UnsavedChanges) { var userWantsToSave = await this._dialogService.ShowDialog(new UnsavedChangesDialog()); - if (userWantsToSave is null) return; + switch (userWantsToSave) + { + case null: + return; + case true: + this.StartTagSaveCommand.Execute(null); + break; + } } - var storageProvider = desktop.MainWindow?.StorageProvider; if (storageProvider is null) return; @@ -338,8 +351,18 @@ public partial class MainWindowViewModel : ViewModelBase Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop || desktop.MainWindow is null) return; - var userWantsToSave = await this._dialogService.ShowDialog(new UnsavedCancelDialog()); - if (userWantsToSave is null) return; + if (this.UnsavedChanges) + { + var userWantsToSave = await this._dialogService.ShowDialog(new UnsavedChangesDialog()); + switch (userWantsToSave) + { + case null: + return; + case true: + this.StartTagSaveCommand.Execute(null); + break; + } + } var storageProvider = desktop.MainWindow?.StorageProvider; if (storageProvider is null) return;