using Microsoft.UI.Xaml;
using System.Collections.ObjectModel;
using Telerik.Core;

namespace TelerikWinUIApp18
{
    public sealed partial class MainWindow : Window
    {
        public MainWindow()
        {
            this.InitializeComponent();
            this.gridPanel.DataContext = new MainViewModel();
        }
    }

    public class MainViewModel : ViewModelBase
    {
        ObservableCollection<RowInfo> selectedItems;
        public ObservableCollection<RowInfo> SelectedItems
        {
            get { return selectedItems; }
            set
            {
                this.selectedItems = value;
                OnPropertyChanged("SelectedItems");
            }
        }
        public ObservableCollection<RowInfo> Items { get; set; }

        public MainViewModel()
        {
            Items = new ObservableCollection<RowInfo>();
            for (int i = 0; i < 9000; i++)
            {
                Items.Add(new RowInfo() { Id = "ID" + i, Name = "Name " + i });
            }

            SelectedItems = new ObservableCollection<RowInfo>();
            for (int i = 0; i < 10; i++)
            {
                SelectedItems.Add(Items[i]);
            }
        }
    }

    public class RowInfo
    {
        public string Id { get; set; }
        public string Name { get; set; }
    }
}
