What is the best way to determine which items are visible while scrolling in a CollectionView?

Platform: .NET MAUI| Category: Collection View

Use ItemsViewScrolled in MAUI. The event arguments provide the indices of the first, center, and last visible items.

void OnItemsViewScrolled(object s, ItemsViewScrolledEventArgs e)
{
  var first = e.FirstVisibleItemIndex;
  var center = e.CenterItemIndex;
  var last = e.LastVisibleItemIndex;
}

Share with