private void LoadData() { this.IsLoading = true; this.JobExecuteResultList.Clear(); Task.Factory.StartNew(() => { var list = this.ClientService.JobService.QueryJobExecuteResult(this.Job.ID, 20); this.IsLoading = false; this.InvokeOnUIDispatcher(() => { foreach (var item in list) { var model = new JobExecuteModel(); model.SetData(item); this.JobExecuteResultList.Add(model); } }); }); }
private void OnJobExecuted(Model.JobExecuteInfo executeInfo) { if (this.Job != null && executeInfo.JobID != this.Job.ID) { return; } var model = this.JobExecuteResultList.SingleOrDefault(t => t.ID == executeInfo.ID); if (model == null) { model = new JobExecuteModel(); this.JobExecuteResultList.Insert(0, model); } model.SetData(executeInfo); }