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

Proposal: Add incremental loading support for ItemsRepeater #374

Open
DL444 opened this issue Mar 3, 2019 · 11 comments
Open

Proposal: Add incremental loading support for ItemsRepeater #374

DL444 opened this issue Mar 3, 2019 · 11 comments
Labels
area-ItemsRepeater feature proposal New feature proposal team-Controls Issue for the Controls team

Comments

@DL444
Copy link

DL444 commented Mar 3, 2019

Proposal: Add incremental loading support for ItemsRepeater

Summary

Add incremental loading support for ItemsRepeater.

Rationale

Currently ItemsRepeater control does not support item sources implementing incremental loading (ISupportIncrementalLoading interface). Using such source results in no items being load.

However, right now using ItemsRepeater and creating custom VirtualizingLayout is the only way developers can create custom virtualizing ListView-like UI.

ListView and GridView support incremental loading only when using the two built-in VirtualizingPanel, and there is no way to create custom ones. That means developers must sacrifice either incremental loading or layout flexibility.

If ItemsRepeater control could support incremental loading, the problem would be solved.

Functional Requirements

Important Notes

Open Questions

  • Does incremental loading need to include support for both starting at the top and scrolling down (i.e. what ListView currently supports) as well as starting from the bottom and scrolling up (e.g. a chat view)?
  • Or starting in the middle and scrolling up or down (e.g. some kind of feed that needs to restore the scroll position of a list after navigating away and back)?
  • Is having the data source implement ISupportIncrementalLoading (or something equivalent that supports the above two scenarios) be preferred over explicitly listening to the viewport position and fetching new data?
@DL444 DL444 added the feature proposal New feature proposal label Mar 3, 2019
@msft-github-bot msft-github-bot added this to New proposal in Feature tracking Mar 3, 2019
@msft-github-bot msft-github-bot added this to Needs triage in Controls Triage Mar 3, 2019
@jevansaks jevansaks moved this from Needs triage to Approved - Assigned in Controls Triage Mar 6, 2019
@micahl
Copy link
Contributor

micahl commented Mar 21, 2019

@DL444, are there layout(s) you already have in mind with which you'd want to use incremental loading?

An alternative to ISupportIncrementalLoading on which I'd be interested to hear your feedback would be to observe the position of the ScrollViewer's viewport and load more data in your items source as the viewport approaches the extent. With ListView/GridView that would have been hard to do. They didn't make their internal ScrollViewer readily accessible. With ItemsRepeater having no control template you're forced to provide your own ScrollViewer. Depending on your perspective that may be good or bad, but it does make it easy to access and observe the viewport. Your thoughts?

@DL444
Copy link
Author

DL444 commented Mar 21, 2019

@micahl It was a custom virtualizing layout that I created, basically the same layout as the StaggeredPanel in Windows Community Toolkit. I also noticed there is a PinterestLayout in test code, the same as well.
I've tried the alternative, and it works, I'm using it right now.

@micahl
Copy link
Contributor

micahl commented Mar 21, 2019

@DL444 Cool. Given your experience, which approach would you prefer to use? Should we keep this proposal open as-is or modify it to track updating the doc to explicitly call out this approach to incrementally load data?

@DL444
Copy link
Author

DL444 commented Mar 23, 2019

@micahl Well, I think it's okay to just update the document and close this for now, but I still want this implemented in the future, as the alternative solution:

  • Sounds more like a hack
  • Requires some extra work by developers
  • Is somewhat harder to implement using MVVM

But the alternative solution does work, and I understand that you might have priorities, so for now I think both is okay.

@micahl
Copy link
Contributor

micahl commented Mar 23, 2019

Good feedback! I'll add a note to the docs. Let's also keep this proposal open to discuss options and potential requirements for enabling support for incremental loading.

@jevansaks jevansaks moved this from Approved - Assigned to Approved in Controls Triage May 7, 2019
@micahl micahl removed their assignment Aug 13, 2019
@chrisahill
Copy link

chrisahill commented Oct 11, 2019

I've had to make a really custom implementation around ListView to get a grid of items with headers that supports virtualization, incremental loading, pull to refresh logic because ListView and GridView really didn't support the UI on UWP that our designer made for iOS and Android which had controls that could support what the designer created, which led me to have to figure out how to make that design work on UWP. The CollectionView could handle header and items, but doesn't implement the ISupportIncremental interface and CollectionView was sealed so I couldn't extend it, which led me down the road of hacking ListView to make it look like a GridView because GridView didn't work the way I needed it to. I then had to create my own CollectionView that supports ISupportIncrementalLoading The ItemRepeater sample we mocked out does everything that we needed, but didn't exist at the time we needed it, but the only thing that's missing to migrate to this control is support for incremental loading. Please add because I'd really like to migrate over to this control.

@HppZ
Copy link

HppZ commented Nov 26, 2021

@chrisahill CAN'T AGREE MORE.

@HppZ
Copy link

HppZ commented Nov 26, 2021

support incremental loading. @chingucoding

@marcelwgn
Copy link
Contributor

@HppZ Nothing I can do...

@HppZ
Copy link

HppZ commented Dec 3, 2021

@HppZ Nothing I can do...

why or who can?

@marcelwgn
Copy link
Contributor

First the proposal needs to be added to the backlog of things to be implemented, than there needs to be an API review (probably not gonna be a big one) and while that is happening it can be developed by someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ItemsRepeater feature proposal New feature proposal team-Controls Issue for the Controls team
Projects
Development

No branches or pull requests

6 participants