Files
Radio/src/Radiosender/Views/ErrorPopup.cs
T
fraujulianandClaude Opus 5.5 459f8ea7f5 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>
2026-11-26 09:39:47 +01:00

20 lines
691 B
C#

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();
}