|
|
@ -635,9 +635,17 @@ namespace Avalonia.Controls |
|
|
throw new InvalidOperationException("Cannot re-show a closed window."); |
|
|
throw new InvalidOperationException("Cannot re-show a closed window."); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (parent != null && parent.PlatformImpl == null) |
|
|
if (parent != null) |
|
|
{ |
|
|
{ |
|
|
throw new InvalidOperationException("Cannot Show a Window with a closed parent."); |
|
|
if (parent.PlatformImpl == null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new InvalidOperationException("Cannot Show a Window with a closed parent."); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (parent == this) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new InvalidOperationException("A Window cannot be its own parent."); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (IsVisible) |
|
|
if (IsVisible) |
|
|
@ -719,6 +727,11 @@ namespace Avalonia.Controls |
|
|
throw new InvalidOperationException("Cannot Show a Window with a closed owner."); |
|
|
throw new InvalidOperationException("Cannot Show a Window with a closed owner."); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (owner == this) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new InvalidOperationException("A Window cannot be its own owner."); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (IsVisible) |
|
|
if (IsVisible) |
|
|
{ |
|
|
{ |
|
|
throw new InvalidOperationException("The window is already being shown."); |
|
|
throw new InvalidOperationException("The window is already being shown."); |
|
|
|