Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

[Feature] StaggeredLayout based on ItemsRepeater #3114

Closed

Description

@DL444

Describe the problem this feature would solve

The current StaggeredPanel in this toolkit is based on Panel class, which doesn't offer UI virtualization. Memory consumption can go very high when a large amount of items are loaded.

Describe the solution

We could enable UI virtualization if we build a StaggeredLayout based on ItemsRepeater. This new control could have the same API as the existing StaggeredPanel.

Additional context & Screenshots

I've already built a prototype in-house. It still needs some polishing, but I hope to get it ready in the WinUI 3.0 timeframe. This should be in-line with 7.0 release plan #3062.

Activity

  1. michael-hawker commented on Jan 29, 2020

    @michael-hawker
    Member

    @DL444 @JustinXinLiu mentioned you had interest in working on this feature. Let us know. I know @skendrot had interest in this as well, so feel free to coordinate.

  2. skendrot commented on Jan 30, 2020

    @skendrot
    Contributor

    @DL444 I'm currently in the process of converting all of the panels within the toolkit (WrapPanel and StaggeredPanel currently) to use the ItemsRepeater.
    I took a look at your repo and it's looking good, however there are rendering issues. In the picture below the left side is my current StaggeredLayout control and the right is yours. You can see how the items are not rendering properly on the right hand side

    image

    It's not all roses on my side. This ItemsRepeater is taking some time learning how to work with it and there's no information out there except for the core **Layout source

  3. DL444 commented on Jan 31, 2020

    @DL444
    ContributorAuthor

    @skendrot I see. This is what I mean by "polishing". That code wasn't really tested for all situations.
    By the way, how could I reproduce that issue? It seems that one change is the width of the rectangles.

  4. skendrot commented on Jan 31, 2020

    @skendrot
    Contributor

    @DL444 I just added a bunch of random items

    for (int i = 0; i < random.Next(500, 5000); i++)
    {
        Item item = new Item { Index = i, Width = random.Next(75, 250), Height = random.Next(75, 250), Color = Color.FromArgb(255, (byte)random.Next(0, 255), (byte)random.Next(0, 255), (byte)random.Next(0, 255)) };
        _items.Add(item);
    }
    
  5. michael-hawker commented on Jan 31, 2020

    @michael-hawker
    Member

    Thanks @skendrot for the updates! 🦙❤

    I created a 7.0 branch. We should pull all the layout panels into their own package as a first step so we don't pull the WinUI dependency in for all the controls yet. Let me know if you need a hand creating the new project structure or not.

  6. added this to the 7.0 milestone on Feb 3, 2020
  7. self-assigned this
    on Mar 4, 2020
  8. modified the milestones: 7.0, 6.1 on Apr 2, 2020
  9. ghost locked as resolved and limited conversation to collaborators on Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions