/// <summary> /// Deletes the selected vehicle in the combobox when clicked /// </summary> private void button_del_vehicle_Click(object sender, RoutedEventArgs e) { Vehicle v = (Vehicle)this.comboBox_Del_Vehicle.SelectedItem; if (v != null) { mycardealer.DeleteVehicle(v.LicensePlate); } mycardealer.SaveVehiclesToFile(); this.comboBox_Del_Vehicle.ItemsSource = mycardealer.LoadVehicles(); //MessageBox.Show(mycardealer.ToString()); }