private async Task <IEnumerable <Pin> > GetData(uint startIndex, int page) { if (CurrentBoard == null) { return(new List <Pin>()); } IsLoading = true; try { var list = await Context.API.BoardAPI.GetPins(CurrentBoard.board_id, PinListViewModel.GetMaxPinID()); foreach (var item in list) { item.Width = PinListViewModel.ColumnWidth; if (item.file != null) { item.Height = ((PinListViewModel.ColumnWidth - 0.8) * item.file.height / item.file.width); } } return(list); } catch (Exception ex) { } finally { IsLoading = false; } return(null); }
private async Task <IEnumerable <Pin> > GetPinList(uint startIndex, int page) { IsLoading = true; List <Pin> list = new List <Pin>(); try { list = await Context.API.UserAPI.GetFollowing(PinListViewModel.GetMaxPinID()); foreach (var item in list) { item.Width = PinListViewModel.ColumnWidth; if (item.file != null) { item.Height = ((PinListViewModel.ColumnWidth - 0.8) * item.file.height / item.file.width); } } return(list); } catch (Exception ex) { } finally { IsLoading = false; } return(list); }
private async Task <IEnumerable <Pin> > GetData(uint startIndex, int page) { if (CurrentCategory == null) { return(new List <Pin>()); } IsLoading = true; try { var list = await CategoryApi.GetCategoryPinList(CurrentCategory.nav_link, 20, PinListViewModel.GetMaxPinID()); foreach (var item in list) { item.Width = PinListViewModel.ColumnWidth; if (item.file != null) { item.Height = ((PinListViewModel.ColumnWidth - 0.8) * item.file.height / item.file.width); } } if (list.Count == 0) { PinListViewModel.PinList.NoMore(); } else { PinListViewModel.PinList.HasMore(); } return(list); } catch (Exception ex) { } finally { IsLoading = false; } return(null); }