Browse Source

fix unit test.

pull/9562/head
Dan Walmsley 3 years ago
parent
commit
4a490694a2
  1. 43
      src/Avalonia.Controls/Window.cs

43
src/Avalonia.Controls/Window.cs

@ -567,30 +567,39 @@ namespace Avalonia.Controls
/// </summary>
public override void Hide()
{
if (!_shown)
try
{
return;
}
IgnoreVisibilityChange = true;
if (!_shown)
{
return;
}
Renderer?.Stop();
Renderer?.Stop();
if (Owner is Window owner)
{
owner.RemoveChild(this);
}
if (Owner is Window owner)
{
owner.RemoveChild(this);
}
if (_children.Count > 0)
{
foreach (var child in _children.ToArray())
if (_children.Count > 0)
{
child.child.Hide();
foreach (var child in _children.ToArray())
{
child.child.Hide();
}
}
}
Owner = null;
PlatformImpl?.Hide();
IsVisible = false;
_shown = false;
Owner = null;
PlatformImpl?.Hide();
IsVisible = false;
_shown = false;
}
finally
{
IgnoreVisibilityChange = false;
}
}
/// <summary>

Loading…
Cancel
Save