MainWindow: Fix crash on closing, when other window is in editing or creating mode
All checks were successful
Test / Run tests (push) Successful in 2m1s
All checks were successful
Test / Run tests (push) Successful in 2m1s
This commit is contained in:
@ -19,14 +19,14 @@ namespace Elwig.Windows {
|
||||
|
||||
private bool _isEditing;
|
||||
private bool _isCreating;
|
||||
protected bool IsEditing {
|
||||
public bool IsEditing {
|
||||
get { return _isEditing; }
|
||||
set {
|
||||
_isEditing = value;
|
||||
LockContext = IsEditing || IsCreating;
|
||||
}
|
||||
}
|
||||
protected bool IsCreating {
|
||||
public bool IsCreating {
|
||||
get { return _isCreating; }
|
||||
set {
|
||||
_isCreating = value;
|
||||
|
@ -35,7 +35,7 @@ namespace Elwig.Windows {
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, CancelEventArgs evt) {
|
||||
if (App.NumWindows > 1 && !App.ForceShutdown) {
|
||||
if (App.NumWindows > 1 && !App.ForceShutdown && !App.Current.Windows.Cast<Window>().Any(w => ((w as AdministrationWindow)?.IsEditing ?? false) || ((w as AdministrationWindow)?.IsCreating ?? false))) {
|
||||
var res = MessageBox.Show("Es sind noch weitere Fenster geöffnet.\nSollen alle Fenster geschlossen werden?",
|
||||
"Elwig beenden", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No);
|
||||
if (res != MessageBoxResult.Yes) {
|
||||
|
Reference in New Issue
Block a user