public BusesPage(ViewModel vm, BusForView busToEdit) { edit = true; InitializeComponent(); this.vm = vm; bfv = busToEdit; busSize.Text = busToEdit.capacity.ToString(); numBuses.Text = busToEdit.quantity.ToString(); isAccess.IsChecked = busToEdit.access; }
private void Button_Click_BusDelete(object sender, RoutedEventArgs e) { if (BusList.SelectedIndex != -1) { // Delete buses here BusForView toDelete = BusList.SelectedItem as BusForView; vm.allBusSettings.Remove(toDelete); refreshListBoxes(); } else { MessageBox.Show("There is no bus selected to delete."); } }