Exemplo n.º 1
0
        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var id = CarsCollection.ElementAt(CarListView.SelectedIndex).Id;

                viewModel.DeleteCar(id);
                MessageBox.Show("Record has been deleted.", "Delete Car");
            }
            catch (ArgumentException)
            {
                MessageBox.Show("First you have to select character you want to delete.", "Delete Car");
            }
        }