Elwig: Add InteractionService to centrally manage MessageBox and SaveFileDialogs
Test / Run tests (push) Successful in 2m50s

This commit is contained in:
2026-06-29 02:27:05 +02:00
parent b93e987685
commit fcd0555e4d
29 changed files with 419 additions and 542 deletions
+2 -3
View File
@@ -1,5 +1,6 @@
using Elwig.Helpers;
using Elwig.Models.Entities;
using Elwig.Services;
using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
@@ -300,9 +301,7 @@ namespace Elwig.Windows {
try {
await Save();
} catch (Exception exc) {
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
MessageBox.Show(str, "Stammdaten aktualisieren", MessageBoxButton.OK, MessageBoxImage.Error);
InteractionService.ShowDbException("Stammdaten aktualisieren", exc);
SaveButton.IsEnabled = true;
Mouse.OverrideCursor = null;
return;