private void btnPlay_Click(object sender, RoutedEventArgs e) { List <string> names = new List <string>(); if (tbxPlayer1Name.IsEnabled) { names.Add(tbxPlayer1Name.Text); } if (tbxPlayer2Name.IsEnabled) { names.Add(tbxPlayer2Name.Text); } if (tbxPlayer3Name.IsEnabled) { names.Add(tbxPlayer3Name.Text); } if (tbxPlayer4Name.IsEnabled) { names.Add(tbxPlayer4Name.Text); } goFishPage = new GoFishPage(names.ToArray(), null); NavigationService.Navigate(goFishPage); }
public override void Load(string path) { BinaryFormatter format = new BinaryFormatter(); GoFishGame state = (GoFishGame)format.Deserialize(File.Open(path, FileMode.Open)); page = state.page; deck = state.deck; players = state.players; currPlayer = state.currPlayer; gameHasEnded = state.gameHasEnded; }