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

Bug: Unhandled Windows.UI.Xaml.LayoutCycleException from ProgressBar with Large Maximum #9872

Closed
Brian-at-Baebies opened this issue Aug 2, 2024 · 1 comment
Labels
area-Progress ProgressBar, ProgressRing bug Something isn't working product-winui2 team-Controls Issue for the Controls team

Comments

@Brian-at-Baebies
Copy link

Describe the bug

MCRE example attached.

In summary:

ProgressBar.Maximum set to some high value (3000, e.g.), and Value set to nearly 100% (2998, e.g.), causes an unhandled Windows.UI.Xaml.LayoutCycleException.

MCRE_LayoutCycleDetected.zip

Steps to reproduce the bug

  1. Build the attached MCRE solution
  2. Run the solution
  3. Click the "Set" button
  4. Observe unhandled exception

May need to play around with "Value" to hit it (in my testing, 2999 did not cause the exception, but 2998 did).

Expected behavior

ProgressBar reflects Value and Maximum; no LayoutCycleException thrown

Screenshots

No response

NuGet package version

None

Windows version

Windows 10 (21H2): Build 19044

Additional context

Actual Windows version is Windows 10 Professional 22H2 Build 19045.4291 (not an option in the drop-down above)
Ms.NETCore.UniversalWindowsPlatform is version 6.2.14 (latest stable as of this writing)

@Brian-at-Baebies Brian-at-Baebies added the bug Something isn't working label Aug 2, 2024
@Brian-at-Baebies Brian-at-Baebies changed the title Bug: Unhandled Windows.UI.Xaml.LayoutCycleException from ProgressBar with Large MaximumBug title Bug: Unhandled Windows.UI.Xaml.LayoutCycleException from ProgressBar with Large Maximum Aug 2, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Aug 2, 2024
@codendone codendone added area-Progress ProgressBar, ProgressRing team-Controls Issue for the Controls team product-winui2 and removed needs-triage Issue needs to be triaged by the area owners labels Aug 7, 2024
@codendone
Copy link
Contributor

There is a fix for this issue in WinUI3. There are no plans to try to bring the fix to WinUI2.

Your example includes Margin="5" on the ProgressBar. Part of the issue is ProgressBar doesn't handle Margin properly, so removing Margin from this element (and setting it on an ancestor panel, if needed) will hopefully be sufficient for you to avoid this issue.

@codendone codendone closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Progress ProgressBar, ProgressRing bug Something isn't working product-winui2 team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

2 participants