private void btnAdd_Click(object sender, RoutedEventArgs e) { EditPowerWindow window = new EditPowerWindow(null); window.SetPowerType(PowerType); if (window.ShowDialog(Application.Current.MainWindow)) { Power power = new Power(Player); window.UpdatePower(power); Player.Powers.Add(power); } }
private void EditSelectedItem() { Power power = (lvMain.SelectedItem as Power); if (power == null) { return; } EditPowerWindow window = new EditPowerWindow(power); if (window.ShowDialog(Application.Current.MainWindow)) { window.UpdatePower(power); } }