private void Button_Click(object sender, RoutedEventArgs e) { if (playerCount.SelectedIndex >= 0) { var newWindow = new BingoControl(playerCount.SelectedIndex); newWindow.Show(); this.Close(); } }
public PlayerWindow(int playerindex, BingoControl control) { InitializeComponent(); this.control = control; completion = 0; this.playerindex = playerindex; this.Title = "Player " + (playerindex + 1).ToString(); for (int i = 0; i < 25; i++) { labels[i] = new Label(); labels[i].HorizontalAlignment = HorizontalAlignment.Center; labels[i].VerticalAlignment = VerticalAlignment.Center; labels[i].FontSize = 20; Grid.SetColumn(labels[i], i % 5); Grid.SetRow(labels[i], i / 5 + 1); grid.Children.Add(labels[i]); } playername = "Player " + (playerindex + 1); CreareMatrice(); }