Closed MartinZikmund closed 2 months ago
I can replicate this issue only on Skia (I updated the description for it) and very interestingly only when there is only one Control placed in the content:
When I put a StackPanel
with more items, I can no longer reproduce the issue:
@jeromelaban, @MartinZikmund just a note that SettingsCard
is used as an example for the WCT documentation
https://platform.uno/docs/articles/uno-community-toolkit-v8.html?tabs=singleproj
So best if we could prioritize fixing this issue I think
@MartinZikmund @agneszitte The issue is a regression caused by changes in https://github.com/unoplatform/uno/pull/16834 I also validated this with https://github.com/unoplatform/uno/pull/17223, but the issue still persists. I checked with @Youssef1313 on this, and there will need to be more investigation to properly fix this. For now, we could implement a workaround or add a note to the documentation (https://github.com/unoplatform/uno/pull/17374) for users to add a Grid
/StackPanel
before adding content to the SettingsCard
.
@MartinZikmund @agneszitte The issue is a regression caused by changes in #16834 I also validated this with #17223, but the issue still persists. I checked with @Youssef1313 on this, and there will need to be more investigation to properly fix this. For now, we could implement a workaround or add a note to the documentation (#17374) for users to add a
Grid
/StackPanel
before adding content to theSettingsCard
.
Thank you a lot @morning4coffe-dev for all the details, appreciated. I synced with @jeromelaban and @Youssef1313 will be able to investigate this issue as a priority since it is a regression. @Youssef1313 if you have additional comments/details please let us know
The root cause here is that FrameworkElement
is IEnumerable
.
When Content
is ComboBox, IsNullOrEmpty
should simply return false. But in our case because FrameworkElement
s are IEnumerable
s, it could end up returning true incorrectly.
I don't see any way to fix this without a breaking change, other than opening a PR for CommunityToolkit/Windows
to adjust the logic for Uno specifically.
https://github.com/CommunityToolkit/Windows/pull/452 is now merged
@jeromelaban, @MartinZikmund, @Youssef1313 I think we need to keep that issue opened (with maybe a little lower priority for now) as it still needs to be properly fixed at some point.
@Arlodotexe left a comment here in the Windows Community Toolkit code to track this issue for cleanup later on. https://github.com/CommunityToolkit/Windows/pull/452/files
The fix will be a breaking change to make FrameworkElement not IEnumerable which is tracked bt #8339
Current behavior
In latest version of Uno,
SettingsCard
content no longer renders:Expected behavior
Should render
How to reproduce it (as minimally and precisely as possible)
5.4.0-dev.121
)Workaround
No response
Works on UWP/WinUI
None
Environment
No response
NuGet package version(s)
No response
Affected platforms
No response
IDE
No response
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
No response