コード例 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="playerScore">The score of the player. At least time and moves must be filled.</param>
        public GameOver(HighscoreItem playerScore)
        {
            InitializeComponent();

            // Start the fade in animation
            fadeInAnimation.Begin();

            // Show the position textblock and player name textbox only if the
            // score is good enough to make it to the list.
            score = playerScore;
            int position = Highscores.IsNewHighscore(score);

            score.Index = position;
            if (position > 0)
            {
                playerName.Visibility   = Visibility.Visible;
                textBlockPlacement.Text = "Your placement is " + position.ToString();
            }
            else
            {
                playerName.Visibility   = Visibility.Collapsed;
                ConfirmButton.Content   = "Ok";
                textBlockPlacement.Text = "";
            }

            textBlockTime.Text = "Your time was " + score.Time.ToString();
        }
コード例 #2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (score.Index > 0)
     {
         score.Name = playerName.Text;
         Highscores.AddNewHighscore(score);
         playerName.IsReadOnly = true;
     }
     fadeOutAnimation.Begin();
 }
コード例 #3
0
 // Code to execute when the application is activated (brought to foreground)
 // This code will not execute when the application is first launched
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     Highscores.Load();
 }
コード例 #4
0
 // Code to execute when the application is launching (eg, from Start)
 // This code will not execute when the application is reactivated
 private void Application_Launching(object sender, LaunchingEventArgs e)
 {
     Highscores.Load();
 }