Skip to content

Changed Binding to x:Bind in WrapLayoutSample DataTemplates#820

Merged
Arlodotexe merged 7 commits into
CommunityToolkit:mainfrom
Avid29:fix_WrapLayoutSample
Jun 2, 2026
Merged

Changed Binding to x:Bind in WrapLayoutSample DataTemplates#820
Arlodotexe merged 7 commits into
CommunityToolkit:mainfrom
Avid29:fix_WrapLayoutSample

Conversation

@Avid29
Copy link
Copy Markdown
Member

@Avid29 Avid29 commented Jan 9, 2026

Fixes #515

PR Type

What kind of change does this PR introduce?

Bugfix

What is the current behavior?

WrapLayout appear not to load

What is the new behavior?

WrapLayout items appear properly

PR Checklist

Please check if your PR fulfills the following requirements:

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • Tested code with current supported SDKs
  • Header has been added to all new source files
  • Contains NO breaking changes

Other information

@Avid29 Avid29 force-pushed the fix_WrapLayoutSample branch from fccb4d0 to 551e4ed Compare February 7, 2026 19:32
@Arlodotexe Arlodotexe self-requested a review February 10, 2026 18:49
</muxc:ItemsRepeater.Layout>
</muxc:ItemsRepeater>
</ScrollViewer>
<muxc:ItemsRepeater x:Name="WrapRepeater"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the ScrollViewer was removed. ItemsRepeater doesn't have a bullt-in ScrollViewer, we should either add it back or use an ItemsView instead, which uses an ItemsRepeater internally but acts more like a ListView than an ItemsControl.

Copy link
Copy Markdown
Member

@Arlodotexe Arlodotexe Jun 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a bit more digging after @Avid29 pointed out that the ScrollViewer was still present over on Discord:

  • Bad news is that this PR from 2023 rolled over the "deliberately avoiding the double-nested ScrollViewer problem" source design and didn't change any of the samples that already had a ScrollViewer, so we've uncovered that for follow-up.
  • Good news is that the nested ScrollViewer wasn't the source of the performance issue we were seeing with the WrapLayout sample, so reverting that line range back to include it and move us towards the proper gallery-level fix won't cause new issues between now and then.

Let's add the ScrollViewer back and then close this.

Comment thread components/Primitives/samples/WrapLayoutSample.xaml
Comment thread components/Primitives/samples/WrapLayoutSample.xaml
@Avid29 Avid29 requested a review from Arlodotexe May 15, 2026 04:55
@Jay-o-Way
Copy link
Copy Markdown

If we add a scrollviewer, does that create the possibility people will assume it's part of the control..?

@Arlodotexe
Copy link
Copy Markdown
Member

Arlodotexe commented Jun 2, 2026

If we add a scrollviewer, does that create the possibility people will assume it's part of the control..?

@Jay-o-Way Pretty much no, it's part of the sample and not the components source. The scrollview isn't a part of the control to the same extend that the ItemsRepeater isn't a part of the control.

Sample shows off the WrapLayout and example that's easy to copy and get running around the component/control, as with all samples.

Copy link
Copy Markdown
Member

@Arlodotexe Arlodotexe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@Arlodotexe Arlodotexe merged commit 127413c into CommunityToolkit:main Jun 2, 2026
23 checks passed
@Avid29 Avid29 deleted the fix_WrapLayoutSample branch June 2, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WrapLayout gallery sample never loads, is unusably slow under Windows App SDK

4 participants