public BoardPinsPageViewModel(Context context) : base(context) { PinListViewModel = new PinListViewModel(context, GetData); Title = "画板"; LeftHeaderVisibility = Visibility.Collapsed; }
public FollowingViewModel(Context context) : base(context) { Title = ""; PinListViewModel = new PinListViewModel(context, GetPinList); BoardListViewModel = new BoardListViewModel(context, GetBoardList); }
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 (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); }
public PinDetailViewModel(Context context) : base(context) { BoardListViewModel = new BoardListViewModel(context, GetBoardList); UserListViewModel = new UserListViewModel(context, GetLikeList); RecommendListViewModel = new PinListViewModel(context, GetRecommendList); }
public BoardPinsViewModel(Context context) : base(context) { PinListViewModel = new PinListViewModel(context, GetData); Title = "画板"; LeftHeaderVisibility = Visibility.Collapsed; }
public SearchPageViewModel(Context context) : base(context) { LeftHeaderVisibility = Windows.UI.Xaml.Visibility.Collapsed; PinListViewModel = new PinListViewModel(context, GetData); KeyWord = ""; }
public SearchViewModel(Context context) : base(context) { LeftHeaderVisibility = Windows.UI.Xaml.Visibility.Collapsed; PinListViewModel = new PinListViewModel(context, GetData); KeyWord = ""; Title = "搜索"; }
public HomePageViewModel(Context context) : base(context) { Title = "发现"; PinListViewModel = new PinListViewModel(context, GetData); SelecterVisibility = Visibility.Collapsed; }
public UserViewModel(Context context) : base(context) { MyPinListViewModel = new PinListViewModel(context, GetPinList); LikePinListViewModel = new PinListViewModel(context, GetLikePinList); BoardListViewModel = new BoardListViewModel(context, GetBoardList); FollowingListViewModel = new UserListViewModel(context, GetFollowingUserList); FollowerListViewModel = new UserListViewModel(context, GetFollowerList); //BoardListViewModel.BoardList = context.BoardList; }
public override void OnNavigatedTo(HBNavigationEventArgs e) { PinListViewModel model = e.Parameter as PinListViewModel; if (model != null) { PinListViewModel = model; PinListViewModel.OnSelectedChanged += PinListViewModel_OnSelectedChanged; } }
public UserPageViewModel(Context context) : base(context) { MyPinListViewModel = new PinListViewModel(context, GetPinList); LikePinListViewModel = new PinListViewModel(context, GetLikePinList); BoardListViewModel = new BoardListViewModel(context, GetBoardList); FollowingListViewModel = new UserListViewModel(context, GetFollowingUserList); FollowerListViewModel = new UserListViewModel(context, GetFollowerList); //BoardListViewModel.BoardList = context.BoardList; }
public HomeViewModel(Context context) : base(context) { Title = "发现"; PinListViewModel = new PinListViewModel(context, GetData); PinListViewModel.TargetName = "HomePage"; CategoryList = Context.CategoryList; SelecterVisibility = Visibility.Collapsed; LeftHeaderVisibility = Visibility.Collapsed; }
public async override void OnNavigatedTo(HBNavigationEventArgs e) { try { var board = e.Parameter as Board; if (board == null || board == CurrentBoard) { return; } CurrentBoard = await Context.API.BoardAPI.GetBoard(board.board_id); await PinListViewModel.ClearAndReload(); } catch (Exception ex) { } }
public async override void Inited() { base.Inited(); IsLoading = true; try { await CategoryList.LoadMoreItemsAsync(0); CurrentCategory = CategoryList[0]; await PinListViewModel.ClearAndReload(); } catch (Exception ex) { } finally { IsLoading = false; } }
public MessageViewModel(Context context) : base(context) { Title = "消息"; PinListVM = new PinListViewModel(context, GetData); }
public async override void Inited() { base.Inited(); await PinListViewModel.ClearAndReload(); }
public override void Dispose() { PinListViewModel.Dispose(); base.Dispose(); }
public override Size ArrangeOverride(Size finalSize) { PinListViewModel.SetWidth(finalSize.Width); return(finalSize); }
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); }