Browse Source

Invalidate parent measure when child visibility changes.

Fixes #7552 but breaks `ListBoxTests.LayoutManager_Should_Measure_Arrange_All`.
pull/7555/head
Steven Kirk 4 years ago
parent
commit
1f3cb4fa00
  1. 12
      src/Avalonia.Layout/Layoutable.cs

12
src/Avalonia.Layout/Layoutable.cs

@ -141,7 +141,6 @@ namespace Avalonia.Layout
static Layoutable()
{
AffectsMeasure<Layoutable>(
IsVisibleProperty,
WidthProperty,
HeightProperty,
MinWidthProperty,
@ -781,6 +780,17 @@ namespace Avalonia.Layout
{
}
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change)
{
base.OnPropertyChanged(change);
if (change.Property == IsVisibleProperty)
{
DesiredSize = default;
this.GetVisualParent<ILayoutable>()?.ChildDesiredSizeChanged(this);
}
}
/// <inheritdoc/>
protected sealed override void OnVisualParentChanged(IVisual? oldParent, IVisual? newParent)
{

Loading…
Cancel
Save