using MAUICollectionViewTest.Models;
using System.Collections.ObjectModel;

namespace MAUICollectionViewTest.Views;

public partial class PlayerView : ContentPage
{
	public PlayerView()
	{
		InitializeComponent();
	}

    private void LastButton_Clicked(object sender, EventArgs e)
    {
        if (mainCollectionView.ItemsSource is ObservableCollection<Player> players)
            mainCollectionView.ScrollTo(players.Count - 1);
    }

    private void TopButton_Clicked(object sender, EventArgs e)
    {
        mainCollectionView.ScrollTo(0);
    }
}