Exemple #1
0
        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;
        }
Exemple #2
0
 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.");
     }
 }