private void addButton_Click(object sender, RoutedEventArgs e) { var addCar = new AddEditCarWindow(); this.IsEnabled = false; addCar.Closing += AddCar_Closing; }
private void editButton_Click(object sender, RoutedEventArgs e) { if (carsGrid.SelectedItems.Count > 0) { Car car = carsGrid.SelectedItem as Car; var editCar = new AddEditCarWindow(car); this.IsEnabled = false; editCar.Closing += AddCar_Closing; } }