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>
20 lines
691 B
C#
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();
|
|
}
|