// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace CommunityToolkit.Common.Collections; /// /// This interface represents a data source whose items can be loaded incrementally. /// /// Type of collection element. public interface IIncrementalSource { /// /// This method is invoked every time the view need to show more items. Retrieves items based on and arguments. /// /// /// The zero-based index of the page that corresponds to the items to retrieve. /// /// /// The number of items to retrieve for the specified . /// /// /// Used to propagate notification that operation should be canceled. /// /// /// Returns a collection of . /// Task> GetPagedItemsAsync(int pageIndex, int pageSize, CancellationToken cancellationToken = default(CancellationToken)); }