Пример #1
0
        private void StatisticsButton_Click(object sender, RoutedEventArgs e)
        {
            MediaPlayer m = new MediaPlayer();

            string path = System.IO.Path.GetFullPath("digi_plink.wav");

            m.Open(new Uri(path, UriKind.RelativeOrAbsolute));
            m.Play();

            Responses.GetStatistics getStatisticsResponse = new Responses.GetStatistics(0, (float)0, 0, 0, 0, new List<int> { 0, 0, 0, 0, 0 });

            pages.StatisticsPgae statPage = new pages.StatisticsPgae(getStatisticsResponse);
            frame1.NavigationService.Navigate(statPage);
        }
Пример #2
0
        public StatisticsPgae(Responses.GetStatistics getStatisticsResponse)
        {
            InitializeComponent();

            for (int i = 0; i < getStatisticsResponse.highScores.Count; i++)
            {
                ListBox.Items.Add($"{i + 1}.    {getStatisticsResponse.highScores[i]}");
            }

            ListBox1.Items.Add($"Correct answers: {getStatisticsResponse.numberOfCorrectAnswers}");
            ListBox1.Items.Add($"Total answers: {getStatisticsResponse.numberOfTotalAnswers}");
            ListBox1.Items.Add($"Games played: {getStatisticsResponse.numberOfPlayerGames}");
            ListBox1.Items.Add($"Average answer time: {getStatisticsResponse.averageAnswerTime}");
        }