public async void LoadAllComments() { try { pageIndex = 0; var re = await GetComments(pageIndex, pageSize, Moment.ID); MomentComments.Clear(); foreach (var item in re) { MomentComments.Add(item); } } catch (Exception e) { #if DEBUG Services.NotityService.DisplayAlert("Error", e.Message, "OK"); #else Services.NotityService.Notify("获取数据遇到错误"); #endif } finally { } }
public async void Refresh() { try { IsRefreshing = true; pageIndex = 0; var re = await GetComments(pageIndex, pageSize, Moment.ID); if (re == null || re.Length == 0) { this.CanLoadMore = false; } else { MomentComments.Clear(); foreach (var item in re) { MomentComments.Add(item); } } } catch (Exception e) { #if DEBUG Services.NotityService.DisplayAlert("Error", e.Message, "OK"); #else Services.NotityService.Notify("获取数据遇到错误"); #endif } finally { IsRefreshing = false; } }