DeliveryAdminWindow: Small quality of life fixes

This commit is contained in:
2023-09-09 21:33:37 +02:00
parent 0b05cc4e10
commit 898cece0d3
6 changed files with 97 additions and 24 deletions

View File

@ -32,6 +32,7 @@ namespace Elwig.Windows {
LockContext = IsEditing;
}
}
protected bool DoShowWarningWindows = true;
protected bool IsClosing { get; private set; }
private TextBox[] TextBoxInputs;
@ -363,7 +364,7 @@ namespace Elwig.Windows {
}
protected bool InputLostFocus(TextBox input, ValidationResult res, string? msg = null) {
if (!res.IsValid && !IsClosing && (IsEditing || IsCreating))
if (DoShowWarningWindows && !res.IsValid && !IsClosing && (IsEditing || IsCreating))
System.Windows.MessageBox.Show(res.ErrorContent.ToString(), msg ?? res.ErrorContent.ToString(), MessageBoxButton.OK, MessageBoxImage.Warning);
return res.IsValid;
}