private void SetSkills(object sender, ExecutedRoutedEventArgs e) { EndGnomeEdit(); var dlg = new SkillDialog { Owner = this }; var result = dlg.ShowDialog(); if (result == false) { return; } int skillValue; Int32.TryParse(dlg.SkillValue.Text, out skillValue); if (dlg.MilitarySkills.IsChecked == true) { SelectedGnomeRows.ToList().ForEach(x => x.SetMilitarySkills(skillValue)); } if (dlg.ProfessionSkills.IsChecked == true) { SelectedGnomeRows.ToList().ForEach(x => x.SetProfessionSkills(skillValue)); } GnomeGrid.Items.Refresh(); }
private void SetEnemySkills(object sender, ExecutedRoutedEventArgs e) { var dlg = new SkillDialog { Owner = this, ProfessionSkills = { IsChecked = false, IsEnabled = false } }; var result = dlg.ShowDialog(); if (result == false) { return; } int skillValue; Int32.TryParse(dlg.SkillValue.Text, out skillValue); if (dlg.MilitarySkills.IsChecked == true) { SelectedEnemyRows.ToList().ForEach(x => x.SetMilitarySkills(skillValue)); } EnemyGrid.Items.Refresh(); }