Browse Source

Invalidate measure when showing a control.

But not when hiding it.
pull/7555/head
Steven Kirk 4 years ago
parent
commit
ddf266d9ae
  1. 8
      src/Avalonia.Base/Layout/Layoutable.cs

8
src/Avalonia.Base/Layout/Layoutable.cs

@ -797,7 +797,15 @@ namespace Avalonia.Layout
if (change.Property == IsVisibleProperty)
{
DesiredSize = default;
// All changes to visibility cause the parent element to be notified.
this.GetVisualParent<ILayoutable>()?.ChildDesiredSizeChanged(this);
// We only invalidate outselves when visibility is changed to true.
if (change.GetNewValue<bool>())
{
InvalidateMeasure();
}
}
}

Loading…
Cancel
Save