private void Button_Click(object sender, RoutedEventArgs e, Class @class) { UserControl classUC = new ChoiceUC(@class); var confirmWin = new ConfirmWin(classUC); if (confirmWin.ShowDialog() == true) { var parentWindow = (CharacterCreationWindow)Window.GetWindow(this); parentWindow.character.SetClass(@class); ClassSelected?.Invoke(); } }
private void ButtonClick(object sender, RoutedEventArgs e, RaceEnum race) { UserControl raceUC = new ChoiceUC(race); var confirmWin = new ConfirmWin(raceUC); if (confirmWin.ShowDialog() == true) { var parentWindow = (CharacterCreationWindow)Window.GetWindow(this); parentWindow.character.SetRace(race); parentWindow.character.ImageSource = String.Format(@"D:\Projects\DnD_Project\DnD_Project\{0}Icon.png", Enum.GetName(typeof(RaceEnum), race)); RaceSelected?.Invoke(); } }