/// <summary> /// Create a new RegisterVehicle and GarageShop object. /// </summary> public MainWindow() { InitializeComponent(); registerVehicle = new RegisterVehicle(); garageShop = new GarageShop(); garageShop.RestoreLists(); InitializeGUI(); UpdateGUI(); }
/// <summary> /// Add a vehicle when button is clicked. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnRegisterVehicle_Click(object sender, RoutedEventArgs e) { registerVehicle = new RegisterVehicle(); registerVehicle.ShowDialog(); if (registerVehicle.DialogResult.HasValue && registerVehicle.DialogResult.Value) { garageShop.AddVehicle(registerVehicle.Vehicle); UpdateGUI(); } }