using System.Windows;

namespace RGV_WPF_AggregateSelectedRows
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            ((MyViewModel)playersGrid.DataContext).SelectedItems = playersGrid.SelectedItems;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (((MyViewModel)playersGrid.DataContext).SelectedItems.Count > 0)
            {
                ((MyViewModel)playersGrid.DataContext).SelectedItems.RemoveAt(0);
            }
            else
            {
                MessageBox.Show("There are 0 selected items. Please select an item first");
            }

        }

    }
}
