Skip to content

Commit

Permalink
Merge pull request #312 from AvaloniaUI/fix/recycled-cells-not-gettin…
Browse files Browse the repository at this point in the history
…g-layed-out-correctly

Fix layout bug: InvalidateMeasure the parent container as a recycled element is placed into it
  • Loading branch information
grokys authored Nov 5, 2024
2 parents d4a77ff + bcf842a commit dcfffd6
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public Control GetOrCreateElement(object? data, Control parent)

if (e.Parent == parent)
{
parent.InvalidateMeasure();
elements.RemoveAt(i);
return e;
}
Expand All @@ -35,6 +36,7 @@ public Control GetOrCreateElement(object? data, Control parent)

if (e.Parent is null || parentPanel is not null)
{
parent.InvalidateMeasure();
parentPanel?.Children.Remove(e);
Debug.Assert(e.Parent is null);
elements.RemoveAt(i);
Expand Down

0 comments on commit dcfffd6

Please sign in to comment.