public PlayerViewModel(BuilderContext context) : base(context) { PlayerChanged += PlayerViewModel_PlayerChanged; Context.HistoryButtonChange += Player_HistoryButtonChange; Undo = new Command(() => { Context.Undo(); FirePlayerChanged(); Save(); }, () => { return Context.CanUndo(); }); Redo = new Command(() => { Context.Redo(); FirePlayerChanged(); Save(); }, () => { return Context.CanRedo(); }); playerInfo = new PlayerInfoViewModel(this); playerSkills = new PlayerSkillViewModel(this); playerResources = new PlayerResourcesViewModel(this); playerFeatures = new PlayerFeaturesViewModel(this); playerProficiencies = new PlayerProficiencyViewModel(this); playerActions = new PlayerActionsViewModel(this); playerConditions = new PlayerConditionViewModel(this); playerInventory = new PlayerInventoryViewModel(this); playerShops = new PlayerShopViewModel(this); playerInventoryChoices = new PlayerInventoryChoicesViewModel(this); playerJournal = new PlayerJournalViewModel(this); playerForms = new PlayerFormsCompanionsViewModel(this); playerNotes = new PlayerNotesViewModel(this); playerPDF = new PlayerPDFViewModel(this); build = new SwitchToBuildModel(this); UpdateSpellcasting(); UpdateForms(); }
public PlayerViewModel(PlayerModel parent) : base(parent.Context) { Parent = parent; ChildModel = true; PlayerChanged += PlayerViewModel_PlayerChanged; Undo = parent.Undo; Redo = parent.Redo; playerInfo = new PlayerInfoViewModel(this); playerSkills = new PlayerSkillViewModel(this); playerResources = new PlayerResourcesViewModel(this); playerFeatures = new PlayerFeaturesViewModel(this); playerProficiencies = new PlayerProficiencyViewModel(this); playerActions = new PlayerActionsViewModel(this); playerConditions = new PlayerConditionViewModel(this); playerInventory = new PlayerInventoryViewModel(this); playerShops = new PlayerShopViewModel(this); playerInventoryChoices = new PlayerInventoryChoicesViewModel(this); playerJournal = new PlayerJournalViewModel(this); playerForms = new PlayerFormsCompanionsViewModel(this); playerNotes = new PlayerNotesViewModel(this); playerPDF = new PlayerPDFViewModel(this); UpdateForms(); UpdateSpellcasting(); }