private void InitializeAssessment(IUserModel user, ITestEvaluator evaluator, IInterpretationBuilder interpreter) { TaskScheduler scheduler = TaskScheduler.FromCurrentSynchronizationContext(); Task.Factory.StartNew( () => { TestModel test = user.EndTest(evaluator); AssessmentModel assessment = test.Assessments[test.Assessments.Keys.ElementAt(0)]; interpreter.Intepret(assessment); var outcomeViewModels = assessment.Outcomes.Select(x => new OutcomeViewModel(x)).ToList(); return new { Assessment = assessment, Outcomes = outcomeViewModels }; } ) .ContinueWith( task => { _outcomes = task.Result.Outcomes; _assessment = task.Result.Assessment; RaisePropertyChanged(string.Empty); }, scheduler ); }
public void Intepret(IInterpretationBuilder intepretationBuilder) { _intepretation = intepretationBuilder.Intepret(this); }