Skip to content

[Windows] Fixed the exception when using CarouselView PeekAreaInsets Property in OnSizeAllocated method#26865

Merged
rmarinho merged 3 commits intodotnet:mainfrom
Vignesh-SF3580:fix-26822
Jan 7, 2025
Merged

[Windows] Fixed the exception when using CarouselView PeekAreaInsets Property in OnSizeAllocated method#26865
rmarinho merged 3 commits intodotnet:mainfrom
Vignesh-SF3580:fix-26822

Conversation

@Vignesh-SF3580
Copy link
Copy Markdown
Contributor

Issue Detail

A layout cycle exception occurs on Windows when using PeekAreaInsets in the OnSizeAllocated method.

Root Cause

The InvalidateMeasure method was being called individually on each ItemContentControl within ListViewBase. This led to multiple redundant measure invalidations, causing an infinite loop and triggering a layout cycle exception.

Description of Change

The individual InvalidateMeasure calls on each ItemContentControl were replaced with a single InvalidateMeasure call on the parent ListViewBase, ensuring efficient layout recalculations and preventing layout cycle issues.

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #26822

Screenshots

Before
image

After
image

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Dec 30, 2024
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Hey there @Vignesh-SF3580! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@karthikraja-arumugam karthikraja-arumugam added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 31, 2024
@Vignesh-SF3580 Vignesh-SF3580 marked this pull request as ready for review January 2, 2025 13:05
@Vignesh-SF3580 Vignesh-SF3580 requested a review from a team as a code owner January 2, 2025 13:05
@Redth
Copy link
Copy Markdown
Member

Redth commented Jan 2, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Jan 7, 2025
@rmarinho rmarinho merged commit d45ee3e into dotnet:main Jan 7, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Feb 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] Layout could not complete exception arise when using CarouselView PeekAreaInsets Property in OnSizeAllocated method

5 participants