/// <summary> /// Event is raised when the Highscores button is pressed. /// </summary> /// <param name="sender">button</param> /// <param name="e">button eventargs</param> private void Button_Click_2(object sender, RoutedEventArgs e) { var win = new HighScores { /*DataContext = new ViewModelWindow1(tb1.Text)*/ }; win.Show(); }
/// <summary> /// Method that is getting called when the game is over. /// </summary> private void GameIsOver() { this.timer.Stop(); string playerName = string.Empty; var win = new GameOver(); if (win.ShowDialog() == true) { playerName = win.PlayerName; } else { playerName = "NaN"; } this.gl.WriteHighScore(playerName); HighScores hs = new HighScores(); hs.Show(); this.Close(); }