Exemplo n.º 1
0
 public PersonaViewModel(Persona persona, IPersonaList personaList, ISkillList skillList)
 {
     _persona     = persona;
     _personaList = personaList;
     _skillList   = skillList;
     _vm          = PersonaList.FirstOrDefault(x => x.Value == PersonaId);
 }
Exemplo n.º 2
0
        public PersonaViewModel(int compendiumIndex, Persona persona, IPersonaList personaList, ISkillList skillList)
        {
            _compendiumIndex = compendiumIndex;
            _persona         = persona;
            _personaList     = personaList;
            _skillList       = skillList;
            _vm = PersonaList.FirstOrDefault(x => x.Value == PersonaId);
            ResetPersonaCommand = new RelayCommand(_ =>
            {
                if (MessageBox.Show("This will reset stats and skills of your persona. Do you want to continue?",
                                    "Reset Persona to default", MessageBoxButton.YesNo, MessageBoxImage.Warning) != MessageBoxResult.Yes)
                {
                    return;
                }

                ResetPersonaToDefault();
            }, _ => _compendiumIndex >= 0);
        }