/// <summary> /// this is a click event to open Add vehicle on menu bar /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AddVehicle_Clicked(object sender, RoutedEventArgs e) { Guid id = Guid.NewGuid(); AddVehicle addVehicle = new AddVehicle(id); addVehicle.ShowDialog(); VehicleListView.ItemsSource = vehicles; VehicleListView.Items.Refresh(); }
/// <summary> /// this is a click event for edit button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ButtonEdit_Clicked(object sender, RoutedEventArgs e) { Button button = sender as Button; Vehicle vehicleItem = button.DataContext as Vehicle; AddVehicle vehicleAdd = new AddVehicle(this, vehicleItem, false); vehicleAdd.carList = this; vehicleAdd.ShowDialog(); vehicleListView.ItemsSource = vehicles; vehicleListView.Items.Refresh(); }