feat(ui): show errors in a popup with the message

Failed saves, searches, imports and invalid input in the edit windows
now open a modal popup instead of a bar at the top of the page or red
text in the dialog. Hints and warnings stay in the bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
fraujulianandClaude Opus 5.5 committed 2026-11-26 09:39:47 +01:00
1 parent b1d09c6abd
commit 459f8ea7f5
11 files changed
+44 -13

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
using System.Windows;
using Radiosender.Services.Localization;
using MessageBox = Wpf.Ui.Controls.MessageBox;
namespace Radiosender.Views;
// Errors as a modal popup, so they cannot be missed like an InfoBar at the top of a long page.
public static class ErrorPopup
{
public static void Show(DependencyObject source, string title, string message) =>
_ = new MessageBox
{
Title = title,
Content = message,
CloseButtonText = Loc.T("Main_Ok"),
Owner = Window.GetWindow(source) is { IsLoaded: true } owner ? owner : null,
WindowStartupLocation = WindowStartupLocation.CenterScreen,
}.ShowDialogAsync();
}