public override void LoadData() { NavigationHelper.IsBusy = true; BackgroundProcessFactory.RunAsync(null, (o, e) => { e.Result = DBDataSource.GetTestGradeLimit(NavigationHelper.CurrrentTest.Id); }, (o, e) => { NavigationHelper.IsBusy = false; if (e.Error != null) { return; } else { _limits = e.Result as List <TestGradeLimit>; if (_limits != null) { foreach (Grade grade in Enum.GetValues(typeof(Grade))) { var limit = _limits.FirstOrDefault(l => l.Grade == (int)grade); if (limit != null) { switch (grade) { case Grade.Poor: PoorMaxValue = limit.ToPer; break; case Grade.Satisfactory: SatisfyMinValue = limit.FromPer; SatisfyMaxValue = limit.ToPer; break; case Grade.Good: GoodMinValue = limit.FromPer; GoodMaxValue = limit.ToPer; break; case Grade.Excellent: ExcellentMinValue = limit.FromPer; ExcellentMaxValue = limit.ToPer; break; } } } MinuteLimitCount = NavigationHelper.CurrrentTest.MinuteTimeLimit; QuestionCount = NavigationHelper.CurrrentTest.QuestionCount; } } }); }