Browse Source

Quick and dirty hack to fix #1054

This fixes the problem decribed in #1054 but I think there's something wrong with the way we handle top level layout anyway and it's going to need refactoring soon.
pull/1056/head
Steven Kirk 9 years ago
parent
commit
7337a90fc1
  1. 9
      src/Avalonia.Controls/WindowBase.cs

9
src/Avalonia.Controls/WindowBase.cs

@ -29,6 +29,7 @@ namespace Avalonia.Controls
public static readonly DirectProperty<WindowBase, bool> IsActiveProperty =
AvaloniaProperty.RegisterDirect<WindowBase, bool>(nameof(IsActive), o => o.IsActive);
private bool _hasExecutedInitialLayoutPass;
private bool _isActive;
private bool _ignoreVisibilityChange;
@ -136,7 +137,13 @@ namespace Avalonia.Controls
{
EnsureInitialized();
IsVisible = true;
LayoutManager.Instance.ExecuteInitialLayoutPass(this);
if (!_hasExecutedInitialLayoutPass)
{
LayoutManager.Instance.ExecuteInitialLayoutPass(this);
_hasExecutedInitialLayoutPass = true;
}
PlatformImpl?.Show();
}
finally

Loading…
Cancel
Save