示例#1
0
        public InfoExpander(string type)
        {
            InitializeComponent();
            answeredQuestions       = new List <InfoAnswered>();
            questionsAsked          = new List <AnswerQuestion>();
            backdropRect.Height     = 56;
            infoTypeText.Text       = type;
            expandInfoButton.Click += ExpandInfoButton_Click;
            for (int i = 0; i < 4; i++)
            {
                InfoAnswered ia = new InfoAnswered();
                expandedCanvas.Children.Add(ia);
                answeredQuestions.Add(ia);
            }
            AskQuestion aq = new AskQuestion();

            expandedCanvas.Children.Add(aq);
        }
示例#2
0
        public void answerQuestion(String question, String answer)
        {
            InfoAnswered ia = new InfoAnswered();

            ia.answerText.Text   = answer;
            ia.questionText.Text = question;
            answeredQuestions.Add(ia);
            List <AnswerQuestion> tempAQ = new List <AnswerQuestion>();

            foreach (AnswerQuestion aq in questionsAsked)
            {
                tempAQ.Add(aq);
            }
            foreach (AnswerQuestion aq in tempAQ)
            {
                if (aq.quesText.Text == question)
                {
                    questionsAsked.Remove(aq);
                }
            }
            updateElements();
        }