public AttackCreationPage(CharacterPage parentCharcterPage) { InitializeComponent(); ModifierPicker.ItemsSource = parentCharcterPage._character.modifiers.Keys.ToList(); DicePicker.ItemsSource = Dice.Keys.ToList(); _parentCharacterPage = parentCharcterPage; }
public AttackPage(string attackName, Attack attack, CharacterPage characterPageParent) { InitializeComponent(); AttackNameLabel.Text = attackName; AttackNameToolbarItem.Text = attackName; AttackName = attackName; _attack = attack; _characterPageParent = characterPageParent; }
async void CharacterDoneButton_Clicked(object sender, EventArgs e) { if (!string.IsNullOrEmpty(CharacterNameEntry.Text)) { var characterPage = new CharacterPage(new Character(CharacterNameEntry.Text , Strength: (int)StrengthValuePicker.SelectedItem , Constitution: (int)ConstitutionValuePicker.SelectedItem , Dexterity: (int)DexterityValuePicker.SelectedItem , Wisdom: (int)WisdomValuePicker.SelectedItem , Charisma: (int)CharismaValuePicker.SelectedItem , Intelligence: (int)IntelligenceValuePicker.SelectedItem , Level: (int)CharacterLevelValuePicker.SelectedItem )); MainPage.characters.Add(characterPage); await Navigation.PopModalAsync(); } }