private void RecycleItems(ItemLayoutInfo layoutInfo) { foreach (var child in Children) { var virtualItemIndex = GetVirtualItemIndex(child); if (virtualItemIndex < layoutInfo.FirstRealizedItemIndex || virtualItemIndex > layoutInfo.LastRealizedItemIndex) { var generatorPosition = _itemsGenerator.GeneratorPositionFromIndex(virtualItemIndex); if (generatorPosition.Index >= 0) { _itemsGenerator.Recycle(generatorPosition, 1); } } SetVirtualItemIndex(child, -1); } }