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:
1 parent
b1d09c6abd
commit
459f8ea7f5
11 files changed
+44
-13
No files matched your search
@@ -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();
|
||||
}
|
||||
Reference in new issue
Block a user