private void ExecuteAddDamage() { AddDamageWindowViewModel addDamageWindowViewModel = new AddDamageWindowViewModel(); Model.Damage damage = addDamageWindowViewModel.GetDamage(); if (damage != null) { DamageViewModel damageViewModel = new DamageViewModel { Damage = damage }; Damages.Add(damageViewModel); } }
private void ExecuteEditDamage() { if (SelectedDamage < Damages.Count) { AddDamageWindowViewModel addDamageWindowViewModel = new AddDamageWindowViewModel(Damages[SelectedDamage].Damage); Model.Damage damage = addDamageWindowViewModel.GetDamage(); if (damage != null) { DamageViewModel damageViewModel = new DamageViewModel { Damage = damage }; Damages[SelectedDamage] = damageViewModel; } } }