private void getPolicies(AutoResetEvent trigger) { policyServiceWrapper.GetAllPolicys((res, exp) => appController.BeginInvokeOnDispatcher(() => { trigger.Set(); if (exp == null) { appController.BeginInvokeOnDispatcher(() => { PolicyList = res; }); } else { appController.HandleException(exp); } })); }
public void Load() { ShowBusyIndicator("در حال دریافت اطلاعات..."); policyService.GetAllPolicys( (res, exp) => appController.BeginInvokeOnDispatcher(() => { HideBusyIndicator(); if (exp == null) { Policys.SourceCollection = res.Result; Policys.TotalItemCount = res.TotalCount; Policys.PageIndex = Math.Max(0, res.CurrentPage - 1); } else { appController.HandleException(exp); } }), Policys.PageSize, Policys.PageIndex + 1); }