/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used when the application is launched to open a specific file, to display /// search results, and so forth. /// </summary> /// <param name="e">Details about the launch request and process.</param> /// private async void InitializeData() { BibleGiantDataSource.currentLevel = Level.Starter; BibleGiantDataSource.levelDictionary = new Dictionary <Level, int>(10) { { Level.Starter, 0 }, { Level.Amateur, 0 }, { Level.Senior, 0 }, { Level.Enthusiast, 0 }, { Level.Professional, 0 }, { Level.Expert, 0 }, { Level.Leader, 0 }, { Level.Veteran, 0 }, { Level.Master, 0 }, { Level.Giant, 0 } }; await BibleGiantDataSource.GetGroupsAsync(); }
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; } }
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; } } } }
async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { QuestionGroup = await BibleGiantDataSource.GetGroupAsync(); this.DefaultViewModel.Question = QuestionGroup; }