This repository has been archived by the owner on May 1, 2024. It is now read-only.
Allow CollectionView on UWP to layout even if items are not loaded #13081
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
Hosting a CollectionView in Shell on UWP could result in a race condition where the items in the CollectionView were not fully loaded (in the UWP Loaded event sense) before a containing layout needed to measure the CollectionView (because items inside a ListViewBase can load asynchronously). This meant that the descendant controls might have IsNativeStateConsistent set to
false
, which then meant that the layout was skipped. This would result in a blank Layout, and could only be corrected by forcing another full layout pass (e.g., by resizing the window).This change forces the IsNativeStateConsistent flag to
true
for the contents of an ItemContentControl inside of a CollectionView, so that the layout step can complete.Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
Automated test (Issue 8814)
PR Checklist