You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Setting a value of NaN to StaggeredLayout.DesiredColumnWidth will cause the app to become unresponsive #4063
Setting a value of NaN for StaggeredLayout.DesiredColumnWidth will cause the app to become unresponsive. Sometimes it will even give the good ol' " has stopped responding" dialog.
Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:
Steps to Reproduce
Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)
Steps to reproduce the behavior:
Go to staggered layout control
Go to xaml tab
Find the staggered layout definition, and set DesiredColumnWidth to NaN
App will become unresponsive, and will eventually crash
If using NaN is not possible, there should be an exception or notification that says this. Also, I don't see anything in the docs about NaN being an invalid parameter.
Screenshots
2021-06-04-113729_Trim.mp4
Environment
NuGet Package(s):
Package Version(s):
Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [x] Insider Build (build number: 19043.1023)
App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)
Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT
Visual Studio
- [ ] 2017 (version: )
- [ ] 2019 (version: )
- [ ] 2019 Preview (version: )
I tried setting StaggeredLayout.DesiredColumnWidth to NaN on the sample app from the store and it crashed instead of becoming unresponsive. Its an issue either way, the sample app should show the error from sample without crashing or freezing.
@winston-de I think the root of the question is why you're trying to use NaN as a value, I find that pretty unusual. I know it works in the panel scenario, but then I'd argue why are you trying to use the Panel like that as then it's just a vertical layout?
Can you elaborate a bit on your main objective/scenario behind this issue (vs. from a technical viewpoint)? Thanks.
@skendrot any thoughts on this in general? Regardless of the reasoning, I'm not sure why it works for the Panel but not the Layout.
Can you elaborate a bit on your main objective/scenario behind this issue (vs. from a technical viewpoint)? Thanks.
@michael-hawker I have no use for this, I just figured the unhandled exception was not the intended behavior, and in my pr implemented what I presumed to be the expected behavior. However, I can imagine that NaN could be passed in instances where the column size is bound to a NumberBox's value property.
Activity
Kyaa-dost commentedon Jun 4, 2021
@winston-de Thanks for the highlight! I am able to repro this as well. Do you want to work on this and create a PR?
winston-de commentedon Jun 4, 2021
@Kyaa-dost Sure!
Rosuavio commentedon Jun 11, 2021
This is relevant to the issue discussion as well. #4064 (comment)
Rosuavio commentedon Jun 11, 2021
I tried setting
StaggeredLayout.DesiredColumnWidthtoNaNon the sample app from the store and it crashed instead of becoming unresponsive. Its an issue either way, the sample app should show the error from sample without crashing or freezing.michael-hawker commentedon Jun 15, 2021
@winston-de I think the root of the question is why you're trying to use
NaNas a value, I find that pretty unusual. I know it works in the panel scenario, but then I'd argue why are you trying to use the Panel like that as then it's just a vertical layout?Can you elaborate a bit on your main objective/scenario behind this issue (vs. from a technical viewpoint)? Thanks.
@skendrot any thoughts on this in general? Regardless of the reasoning, I'm not sure why it works for the Panel but not the Layout.
winston-de commentedon Jun 16, 2021
@michael-hawker I have no use for this, I just figured the unhandled exception was not the intended behavior, and in my pr implemented what I presumed to be the expected behavior. However, I can imagine that
NaNcould be passed in instances where the column size is bound to a NumberBox's value property.Merge branch 'main' into CommunityToolkit#4063
Fix issue where setting StaggeredLayout.ColumnWidth to NaN would caus…