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

[Feature] StaggeredLayout based on ItemsRepeater #3114

Closed
DL444 opened this issue Jan 29, 2020 · 6 comments · Fixed by #3160
Closed

[Feature] StaggeredLayout based on ItemsRepeater #3114

DL444 opened this issue Jan 29, 2020 · 6 comments · Fixed by #3160
Assignees
Labels
Completed 🔥 feature request 📬 A request for new changes to improve functionality
Milestone

Comments

@DL444
Copy link
Contributor

DL444 commented Jan 29, 2020

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.

@DL444 DL444 added the feature request 📬 A request for new changes to improve functionality label Jan 29, 2020
@ghost ghost added the needs triage 🔍 label Jan 29, 2020
@ghost
Copy link

ghost commented Jan 29, 2020

Thanks for submitting a new feature request! I've automatically added a vote 👍 reaction to help get things started. Other community members can vote to help us prioritize this feature in the future!

@michael-hawker
Copy link
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.

@skendrot
Copy link
Contributor

skendrot commented Jan 30, 2020

@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

@DL444
Copy link
Contributor Author

DL444 commented Jan 31, 2020

@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.

@skendrot
Copy link
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);
}

@michael-hawker
Copy link
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.

@michael-hawker michael-hawker added this to the 7.0 milestone Feb 3, 2020
@ghost ghost added the In-PR 🚀 label Mar 4, 2020
@skendrot skendrot self-assigned this Mar 4, 2020
@michael-hawker michael-hawker modified the milestones: 7.0, 6.1 Apr 2, 2020
@ghost ghost added Completed 🔥 and removed In-PR 🚀 labels May 15, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jul 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Completed 🔥 feature request 📬 A request for new changes to improve functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants