CollectionView load more when scrolling up

Stesvis 1,041 Reputation points
2021-02-19T19:56:18.14+00:00

Hello,

is it possible to implement the "load more" functionality in a CollectionView when you scroll up?

I implemented this approach on several occasions:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/collectionview/populate-data#load-data-incrementally

But in every scenario I needed to load more when i reached the bottom (or the right end for horizontal collections).

Now i am implementing something like a chat page, where I load the latest N messages, and I need to load more when i scroll up instead.
I am unable to figure out a way to do this, as it only seems to work for scrolling down.

The other option is to use the Syncfusion SfListView which has that option, but i'd prefer to keep the CollectionView.

Any advice greatly appreciated.

Thanks

Developer technologies | .NET | Xamarin
{count} votes

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,971 Reputation points
    2021-02-20T06:06:47.6+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    CollectionView load more when scrolling up

    Try using RefreshView to wrap the CollectionView. RefreshView provides pull to refresh functionality for scrollable content.

       <RefreshView Command="{Binding RefreshItemsCommand}" IsRefreshing="{Binding IsRefreshing}">  
             
           <CollectionView ...>   
               ...  
           </CollectionView>  
       </RefreshView>  
    

    Tutorial: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/refreshview

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.