private void btnReset_Click(object sender, RoutedEventArgs e) { Game = new TicTacToe(); lblCurrentPlayer.Content = null; NumberPlays = 0; foreach (Button button in Squares) { button.Content = null; button.IsEnabled = true; } }
public MainWindow() { InitializeComponent(); Squares = new Button[9]; Squares[0] = btnUpperLeft; Squares[1] = btnUpperMiddle; Squares[2] = btnUpperRight; Squares[3] = btnLeft; Squares[4] = btnMiddle; Squares[5] = btnRight; Squares[6] = btnLowerLeft; Squares[7] = btnLowerMiddle; Squares[8] = btnLowerRight; Game = new TicTacToe(); NumberPlays = 0; }