private void btnRandomTicket_Tapped(object sender, TappedRoutedEventArgs e) { var mode = AppLogic.Enums.QuestionsGenerationMode.RandomTicket; var parameters = new SessionParameters(mode, false, null); ISession session; var creationResult = SessionFactory.CreateSession(parameters, out session); if (creationResult == AppLogic.Enums.ParametersValidationResult.Valid) { this.Frame.Navigate(typeof(QuestionPage), Serializer.SerializeToString(session)); } else { throw new Exception("This should never happen! Developers, please check parameters creation logic (2)"); } }
private void btnStart_Click(object sender, RoutedEventArgs e) { //creating parameters... var mode = AppLogic.Enums.QuestionsGenerationMode.SelectedTickets; var ticketNums = listTickets.SelectedItems.Cast <SQLiteShared.Models.Tickets>().Select(ticket => ticket.num).ToArray(); var shuffleChecked = Convert.ToBoolean(btnRandomTicket.Tag); var parameters = new SessionParameters(mode, shuffleChecked, ticketNums); ISession session; //creating session... var creationResult = SessionFactory.CreateSession(parameters, out session); if (creationResult == AppLogic.Enums.ParametersValidationResult.Valid) { this.Frame.Navigate(typeof(QuestionPage), Serializer.SerializeToString(session)); } else { throw new Exception("This should never happen! Developers, please check parameters creation logic"); } }