This repository has been archived by the owner on May 1, 2024. It is now read-only.
[UWP] Reuse the element when recycling an ItemContentControl #11043
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hartez
added
a/collectionview
in-progress
This issue has an associated pull request that may resolve it!
p/UWP
labels
Jun 14, 2020
This is great @hartez, I think we'll really see some tangible benefits from this improvement! |
I should have time to implement the DataTemplateSelector checks tomorrow. |
rmarinho
approved these changes
Jun 22, 2020
samhouts
approved these changes
Jun 30, 2020
samhouts
added
the
approved
Has two approvals, no pending reviews, and no changes requested
label
Jun 30, 2020
bmacombe
pushed a commit
to bmacombe/Xamarin.Forms
that referenced
this pull request
Jul 7, 2020
…#11043) fixes xamarin#9051 * Reuse the element when recycling an ItemContentControl; Fixes xamarin#9051 * Ensure that reused ItemContentControl instances respect DataTemplateSelector
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
a/collectionview
approved
Has two approvals, no pending reviews, and no changes requested
in-progress
This issue has an associated pull request that may resolve it!
p/UWP
t/bug 🐛
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
ItemContentControl is currently re-creating the hosted Element and its children when it's reused, rather than using the previously created content.
This change fixes that issue, so the CollectionView won't create new elements for every single item as it scrolls.
Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
Control Gallery -> CollectionView Galleries -> DataTemplate Gallery -> DataTemplateSelector Gallery
If you scroll around and the weekday items remain the same while the weekend items are different, then this is working.
PR Checklist