Exemplo n.º 1
0
 void getQuestionWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     if (_currentQuestion != null) Thread.Sleep(700);
     Question question=null;
     while(question==null)
         try
         {
             question = QuizDB.CreateNewQuestion();
         }
         catch (Exception ex)
         {
             Debug.WriteLine(ex.Message);
         }
     this.Dispatcher.Invoke(new Action(()=>this._currentQuestion = new QuestionVM(question)));
 }
Exemplo n.º 2
0
        void getQuestionWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            if (_currentQuestion != null)
            {
                Thread.Sleep(700);
            }
            Question question = null;

            while (question == null)
            {
                try
                {
                    question = QuizDB.CreateNewQuestion();
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }
            }
            this.Dispatcher.Invoke(new Action(() => this._currentQuestion = new QuestionVM(question)));
        }