internal void RemoveArmy() { _armies.Remove(SelectedArmy); SelectedArmy = null; OnPropertyChanged(nameof(Armies)); }
internal void CopyArmy() { PlanArmy army = SelectedArmy.PlanArmy; army.PlanUnits.Clear(); var armyItems = new List <PlanUnit>(); foreach (PlanUnitViewModel armyItemVM in SelectedArmy.PlanUnits) { PlanUnit armyItem = armyItemVM.PlanUnit; armyItem.Options = armyItemVM.Options.Select(option => option.Option).ToList(); army.PlanUnits.Add(armyItemVM.PlanUnit); } var copiedArmy = new PlanArmyViewModel() { PlanArmy = StaticHelper.DeepClone(army) }; Armies.Add(copiedArmy); SelectedArmy = copiedArmy; }
public void CreateNewArmy() { var newArmy = new PlanArmyViewModel() { PlanArmy = new PlanArmy() }; Armies.Add(newArmy); SelectedArmy = newArmy; }