private void SetEnemyAttributes(object sender, ExecutedRoutedEventArgs e) { var dlg = new AttributeDialog { Owner = this }; var result = dlg.ShowDialog(); if (result == false) { return; } int attributeValue; Int32.TryParse(dlg.AttributeValue.Text, out attributeValue); SelectedEnemyRows.ToList().ForEach(x => x.SetAttributes(attributeValue)); EnemyGrid.Items.Refresh(); }