private void PreviousButton_Click(object sender, RoutedEventArgs e) { if (count == 0) { GetQuestions.question = new Models.RequestResponse(); MainWindow mainWindow = new MainWindow(); mainWindow.Show(); this.Close(); } else { GetQuestions getQuestions = new GetQuestions(); getQuestions.SetPreviousQuestion(); panelForQuestion.Children.RemoveAt(count); count -= 1; } }
public async void QuestionAccordingToChoices() { if (GetQuestions.choicesMade == "Yes,") { GetProductList productList = new GetProductList(); await productList.GetProductsMatchingTheChoices(GetQuestions.question); QuestionBlock display = productList.GetQuestion(); panelForQuestion.Children.Add(display); count += 1; } else { GetQuestions getQuestions = new GetQuestions(); getQuestions.SetPreviousQuestion(); panelForQuestion.Children.RemoveAt(count); count -= 1; } }