Skip to content

Commit

Permalink
make sure the parent container that a recycled element will be insert…
Browse files Browse the repository at this point in the history
…ed into is re-measured.
  • Loading branch information
danwalmsley committed Oct 17, 2024
1 parent da3f3ab commit 4ffa527
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 4ffa527

Please sign in to comment.