Наследование: BaseCharacterModel, IEntity
Пример #1
0
        private void CreateCharacterButton_Click(object sender, RoutedEventArgs e)
        {
            var newCharacter = new Character();

            var characterWindow = new CharacterWindow(newCharacter, _user, true) { Owner = this };
            characterWindow.ShowDialog();
            Execute(async () => await _mainVm.RefreshCharacters()); //reload character to pick up changes
        }
Пример #2
0
        public CharacterVm(Character character, UserModel user, bool isNewCharacter = false)
            : base(user)
        {
            Guard.VerifyObjectNotNull(character, nameof(character));

            _isNewCharacter = isNewCharacter;
            if (_isNewCharacter)
            { character.Name = NewCharacterName; }

            _character = character;
        }
Пример #3
0
        public CharacterWindow(Character character, UserModel user, bool isNewCharacter = false)
        {
            Guard.VerifyObjectNotNull(character, nameof(character));
            Guard.VerifyObjectNotNull(user, nameof(user));

            InitializeComponent();

            _isNewCharacter = isNewCharacter;
            _user = user;
            _characterVm = new CharacterVm(character, user, isNewCharacter);
            DataContext = _characterVm;
            //InitEditorControl(character, user);
        }