From cc46c7ceee6ee61d9ec5d296e01dd076e51ba997 Mon Sep 17 00:00:00 2001 From: Mike Corsaro Date: Mon, 22 Jan 2024 10:37:06 -0800 Subject: [PATCH 1/2] Adjust recycle check in `ItemContentControl` to use Content property --- .../Core/Platform/Windows/CollectionView/ItemContentControl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs b/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs index 4366324f9d3b..16fa439167c9 100644 --- a/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs +++ b/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs @@ -163,7 +163,7 @@ internal void Realize() return; } - if (_handler?.ContainerView is null || _currentTemplate != formsTemplate) + if (Content is null || _currentTemplate != formsTemplate) { // If the content has never been realized (i.e., this is a new instance), // or if we need to switch DataTemplates (because this instance is being recycled) From 279c0ea5430aa1b6285978595b518957d4daf665 Mon Sep 17 00:00:00 2001 From: Mike Corsaro Date: Tue, 23 Jan 2024 10:20:47 -0800 Subject: [PATCH 2/2] Fix confusing line --- .../Core/Platform/Windows/CollectionView/ItemContentControl.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs b/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs index 16fa439167c9..d8d4ee380503 100644 --- a/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs +++ b/src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs @@ -186,7 +186,6 @@ internal void Realize() else { // We are reusing this ItemContentControl and we can reuse the Element - _visualElement = _handler.VirtualView as VisualElement; _visualElement.BindingContext = dataContext; }