Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ItemsRepeater: Avoid layout cycle exception with variable sized children in StackLayout #5002

Merged
merged 3 commits into from
May 17, 2021

Conversation

RBrid
Copy link
Contributor

@RBrid RBrid commented May 12, 2021

Description

Putting in a guard against the XAML framework's layout cycle exception.

Motivation and Context

When a virtualized StackLayout has variable sized children, the estimated extent for the ItemsRepeater may not settle down during a layout pass.
This results in an app crash with the E_LAYOUTCYCLE error. We shortcut the cycle by returning the previous desired size in ItemsRepeater::MeasureOverride and escape the exception.

How Has This Been Tested?

Ad-hoc testing with repro apps.
A regression test is being added too.

@RBrid RBrid requested review from StephenLPeters and ranjeshj May 12, 2021 20:31
@RBrid RBrid self-assigned this May 12, 2021
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label May 12, 2021
@RBrid
Copy link
Contributor Author

RBrid commented May 12, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StephenLPeters StephenLPeters added team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels May 12, 2021
@RBrid
Copy link
Contributor Author

RBrid commented May 12, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@RBrid
Copy link
Contributor Author

RBrid commented May 17, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@RBrid RBrid merged commit 1cf9f1c into main May 17, 2021
@RBrid RBrid deleted the user/regisb/ItemsRepeaterLayoutCycle1 branch May 17, 2021 18:45
@jlaanstra
Copy link
Contributor

jlaanstra commented Jun 17, 2021

@ranjeshj @RBrid Any chance we can get a preview package with this fix? I believe the last preview is from late April?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ItemsRepeater team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants