Skip to content
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

Merged
merged 2 commits into from
Dec 13, 2020

Conversation

hartez
Copy link
Contributor

@hartez hartez commented Dec 8, 2020

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

  • UWP

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

Automated test (Issue 8814)

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@hartez
Copy link
Contributor Author

hartez commented Dec 9, 2020

Failed UI tests have less than nothing to do with these changes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] UWP Shell cannot host CollectionView/CarouselView
4 participants