private void ShowVehicleButton_Click(object sender, RoutedEventArgs e) { try { DataRow dr = dsSelected.Tables[0].Rows[DataGridVehicle.SelectedIndex]; MainVehicle assignmentWindow = new MainVehicle(dr); assignmentWindow.ShowDialog(); } catch (IndexOutOfRangeException) { MessageBoxResult result = MessageBox.Show("Para ver el detalle de un vehículo, selecciona un elemento de la lista", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Warning); } }
private void AddVehicle_Click(object sender, RoutedEventArgs e) { MainVehicle vehicleWindow = new MainVehicle(); vehicleWindow.ShowDialog(); }