private void AddPressed(object sender, RoutedEventArgs e) { EditSkillWindow editSkillWindow = new EditSkillWindow(); if (editSkillWindow.ShowDialog() == true) { MySkillCollection.Add(editSkillWindow.MySkill); lbSkills.Items.Refresh(); } }
private void EditPressed(object sender, RoutedEventArgs e) { // If nothing is selected from the list box, then don't do anything. if (lbSkills.SelectedIndex == -1) { return; } EditSkillWindow editSkillWindow = new EditSkillWindow(); editSkillWindow.MySkill = lbSkills.SelectedItem as Skill; if (editSkillWindow.ShowDialog() == true) { MySkillCollection[lbSkills.SelectedIndex] = editSkillWindow.MySkill; lbSkills.Items.Refresh(); } }