private void Next(object sender, RoutedEventArgs e) { string err_msg = "Fill in all empty fields."; if ((selectedClass is null || selectedRace is null) || (selectedRace.GetType() == typeof(IRace) || selectedClass.GetType() == typeof(IClass)) || (ArtisanTools.IsVisible && ArtisanTools.SelectedItem is null) || (ExtraLanguage.IsVisible && ExtraLanguage.SelectedItem is null) || (RaceProf1.IsVisible && (RaceProf1.SelectedItem is null || RaceProf2.SelectedItem is null)) || (ClassSkill1.SelectedItem is null || ClassSkill2.SelectedItem is null) || (ClassSkill3.IsVisible && ClassSkill3.SelectedItem is null) || (ClassSkill4.IsVisible && ClassSkill4.SelectedItem is null)) { MessageBox.Show(err_msg); return; } cc.SetRaceAndClass(selectedRace, selectedClass); cc.AddProficiency(selectedClassProfs.Union(selectedRaceProfs)); if (cc.GetPlayerLevel() > 1) { int ASICount = cc.GreaterLevel(); if (ASICount > 0) { this.NavigationService.Navigate(new CharacterGeneratorASIPage(cc, ASICount)); return; } } // navigate to final screen cc.RollStats(); PlayerSheetWindow playerSheet = new PlayerSheetWindow(cc); playerSheet.Show(); Window window = this.Parent as Window; window.Close(); }