Пример #1
0
        public void EditCharacterButton_Click(object sender, RoutedEventArgs e)
        {
            Hide();

            Character charToEdit = ((FrameworkElement)sender).DataContext as Character;

            CharacterCreatorWindow charCreatorWin = new CharacterCreatorWindow(charToEdit);

            charCreatorWin.Owner = this;
            charCreatorWin.Show();
        }
Пример #2
0
        private void AddCharacterButton_Click(object sender, RoutedEventArgs e)
        {
            Hide();

            Character newCharacter = new Character();

            int id = Database.CreateCharacter(newCharacter, _userId);

            newCharacter.CharacterId = id;
            newCharacter.Name        = "Character " + id;

            _characters.Add(newCharacter);
            CharListTable.ItemsSource = null;
            CharListTable.ItemsSource = _characters;

            CharacterCreatorWindow charCreatorWin = new CharacterCreatorWindow(newCharacter);

            charCreatorWin.Owner = this;
            charCreatorWin.Show();
        }