Beispiel #1
0
 private async void FiftyFifty_Click(object sender, RoutedEventArgs e)
 {
     if (this.DefaultViewModel.FffIsActive)
     {
         if (QuestionGroup == null)
         {
             QuestionGroup = await BibleGiantDataSource.GetGroupAsync();
         }
         var        matches = QuestionGroup.Options.Where((option) => !(option.IsAnswer.Equals("True")));
         List <int> nums    = new List <int>(3)
         {
             0, 1, 2
         };
         nums.Shuffle();
         matches.ElementAt(nums[0]).Option = ""; matches.ElementAt(nums[1]).Option = "";
         this.DefaultViewModel.Question    = QuestionGroup;
         this.DefaultViewModel.FffIsActive = false;
     }
 }
Beispiel #2
0
        private async void Option_Click(object sender, RoutedEventArgs e)
        {
            if (QuestionGroup == null)
            {
                QuestionGroup = await BibleGiantDataSource.GetGroupAsync();
            }
            var matches = QuestionGroup.Options.Where((option) => option.IsAnswer.Equals("True"));

            if ((sender as Button).Content != null)
            {
                if ((sender as Button).Content.ToString() == matches.First().Option)
                {
                    if (BibleGiantDataSource.currentLevel != Level.Giant)
                    {
                        BibleGiantDataSource.levelDictionary[BibleGiantDataSource.currentLevel]++;
                        BibleGiantDataSource.currentLevel++;
                        QuestionGroup = await BibleGiantDataSource.GetGroupAsync();

                        this.DefaultViewModel.Question = QuestionGroup;
                    }
                }
            }
        }
Beispiel #3
0
        async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            QuestionGroup = await BibleGiantDataSource.GetGroupAsync();

            this.DefaultViewModel.Question = QuestionGroup;
        }