From a8fc03217a99da2d6af754123b356d030b6216c4 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 3 Oct 2019 23:56:30 +0200 Subject: [PATCH] Fix ClearElementToPinnedPool. It was previously (incorrectly) implemented the same as `ClearElementToUniqueIdResetPool`. --- src/Avalonia.Controls/Repeater/ViewManager.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.Controls/Repeater/ViewManager.cs b/src/Avalonia.Controls/Repeater/ViewManager.cs index 3e09a5b3ee..51c14d47d6 100644 --- a/src/Avalonia.Controls/Repeater/ViewManager.cs +++ b/src/Avalonia.Controls/Repeater/ViewManager.cs @@ -581,13 +581,16 @@ namespace Avalonia.Controls private bool ClearElementToPinnedPool(IControl element, VirtualizationInfo virtInfo, bool isClearedDueToCollectionChange) { - if (_isDataSourceStableResetPending) + bool moveToPinnedPool = + !isClearedDueToCollectionChange && virtInfo.IsPinned; + + if (moveToPinnedPool) { - _resetPool.Add(element); - virtInfo.MoveOwnershipToUniqueIdResetPoolFromLayout(); + _pinnedPool.Add(new PinnedElementInfo(element)); + virtInfo.MoveOwnershipToPinnedPool(); } - return _isDataSourceStableResetPending; + return moveToPinnedPool; } private void UpdateFocusedElement()