private void ButtonCreate_Click(object sender, RoutedEventArgs e) { if (TextBoxName.Text.Length > 2) { Character newCharacter = new Character(); newCharacter.MakeCharacter(); newCharacter.CharacterName = TextBoxName.Text; if (Archer.IsChecked == true) { Archer newClass = new Archer(); newClass.MakeClass(); newCharacter.AssignClass(newClass); ViewModel.NewCharacter = newCharacter; Close(); } else if (Monk.IsChecked == true) { Monk newClass = new Monk(); newClass.MakeClass(); newCharacter.AssignClass(newClass); ViewModel.NewCharacter = newCharacter; Close(); } else if (Warrior.IsChecked == true) { Warrior newClass = new Warrior(); newClass.MakeClass(); newCharacter.AssignClass(newClass); ViewModel.NewCharacter = newCharacter; Close(); } else if (Wizard.IsChecked == true) { Wizard newClass = new Wizard(); newClass.MakeClass(); newCharacter.AssignClass(newClass); ViewModel.NewCharacter = newCharacter; Close(); } else { return; } } else { return; } }
private void Warrior_OnChecked(object sender, RoutedEventArgs e) { Warrior warrior = new Warrior(); warrior.MakeClass(); Image.Source = new BitmapImage(new Uri(warrior.ImagePath)); TextBlockDescription.Text = warrior.ClassDescription; }