Exemple #1
0
        // Called when a player character edit button is clicked.
        private void PlayerCharacterEditButton_Click(object sender, RoutedEventArgs e)
        {
            Button          button   = sender as Button;
            PlayerCharacter pc       = button.DataContext as PlayerCharacter;
            var             pcWindow = new EditPlayerCharacterWindow
            {
                DataContext = pc
            };

            pcWindow.Show();
        }
Exemple #2
0
        // Called when the player character add button is clicked.
        private void PlayerCharacterAddButton_Click(object sender, RoutedEventArgs e)
        {
            var pc = new PlayerCharacter
            {
                Name  = "New Player Character",
                Level = 1
            };

            encounter.PlayerCharacters.Add(pc);

            var pcWindow = new EditPlayerCharacterWindow
            {
                DataContext = pc
            };

            pcWindow.Show();
        }