//private void Game6X6Window_Closed(object sender, EventArgs e) //{ // MainWindow mainWindow = new MainWindow(); // mainWindow.Show(); //} private void NewGameButton_Click(object sender, RoutedEventArgs e) { this.Game = new Game_2048(SIZE); this.Game.GameOver += Game_GameOver; this.Game.UpdateScore += Game_UpdateScore; Refresh(); }
public Game6X6Window() { InitializeComponent(); this.Game = new Game_2048(SIZE); this.Game.GameOver += Game_GameOver; this.Game.UpdateScore += Game_UpdateScore; this.KeyDown += Game6X6Window_KeyDown; this.NewGameButton.Click += NewGameButton_Click; //this.Closed += Game6X6Window_Closed; Refresh(); }