private void moveGame(GameButton button, string sign) { button.Content = sign; button.IsEnabled = false; isWinner = c.IfWinner(sign, button.row, button.col); if (isWinner) { MessageBox.Show(sign + " is winner"); resetGame(); } }
private GameButton[,] CreateButtons() { GameButton[,] buttons = new GameButton[boardSize, boardSize]; for (int row = 0; row < boardSize; row++) { for (int col = 0; col < boardSize; col++) { buttons[row, col] = new GameButton(boardSize, row, col); buttons[row, col].VerticalAlignment = VerticalAlignment.Center; buttons[row, col].Click += Button_Click; } } return buttons; }