Ejemplo n.º 1
0
        private async Task <IEnumerable <Board> > GetBoardList(uint startIndex, int page)
        {
            BoardListViewModel.BoardList.NoMore();
            IsLoading = true;

            List <Board> list = new List <Board>();

            try
            {
                list = await PinApi.GetRelatedBoards(Pin?.pin_id, BoardListViewModel.GetMaxSeq());

                if (list.Count == 0)
                {
                    BoardListViewModel.BoardList.NoMore();
                }
                else
                {
                    BoardListViewModel.BoardList.HasMore();
                }
                BoardListViewModel.NotifyPropertyChanged("Count");
            }
            catch (Exception ex)
            {
                string a = ex.Message;
            }
            finally
            {
                IsLoading = false;
            }
            return(list);
        }
Ejemplo n.º 2
0
 public PinDetailViewModel(Context context)
     : base(context)
 {
     BoardListViewModel     = new BoardListViewModel(context, GetBoardList);
     UserListViewModel      = new UserListViewModel(context, GetLikeList);
     RecommendListViewModel = new PinListViewModel(context, GetRecommendList);
 }
Ejemplo n.º 3
0
 public FollowingViewModel(Context context)
     : base(context)
 {
     Title              = "";
     PinListViewModel   = new PinListViewModel(context, GetPinList);
     BoardListViewModel = new BoardListViewModel(context, GetBoardList);
 }
Ejemplo n.º 4
0
		public PinDetailViewModel(Context context)
			: base(context)
		{
			BoardListViewModel = new BoardListViewModel(context, GetBoardList);
			UserListViewModel = new UserListViewModel(context, GetLikeList);
			RecommendListViewModel = new PinListViewModel(context, GetRecommendList);
		}
Ejemplo n.º 5
0
        private async Task <IEnumerable <Board> > GetBoardList(uint startIndex, int page)
        {
            BoardListViewModel.BoardList.NoMore();
            IsLoading = true;

            List <Board> list = new List <Board>();

            try
            {
                await Task.Delay(300);

                list = await Context.API.UserAPI.GetBoards(User?.user_id, BoardListViewModel.GetMaxSeq());

                if (list.Count == 0)
                {
                    BoardListViewModel.BoardList.NoMore();
                }
                else
                {
                    BoardListViewModel.BoardList.HasMore();
                }

                return(list);
            }
            catch (Exception ex)
            {
            }
            finally
            {
                IsLoading = false;
            }
            return(list);
        }
Ejemplo n.º 6
0
        public async override void OnNavigatedTo(HBNavigationEventArgs e)
        {
            try
            {
                var user = e.Parameter as User;
                if (user == null || user == User)
                {
                    return;
                }

                if (user.user_id == Context.User?.user_id)
                {
                    User = user;
                    Context.BoardListVM.BoardList = BoardListViewModel.BoardList;
                }

                else
                {
                    User = await Context.API.UserAPI.GetUser(user.user_id);
                }

                await MyPinListViewModel.ClearAndReload();

                await LikePinListViewModel.ClearAndReload();

                await BoardListViewModel.ClearAndReload();
            }
            catch { }
        }
Ejemplo n.º 7
0
		public FollowingViewModel(Context context)
			: base(context)
		{
			Title = "";
			PinListViewModel = new PinListViewModel(context, GetPinList);
			BoardListViewModel = new BoardListViewModel(context, GetBoardList);
		}
Ejemplo n.º 8
0
 public PinDetailPageViewModel(Context context)
     : base(context)
 {
     BoardListViewModel = new BoardListViewModel(context, GetBoardList);
     UserListViewModel  = new UserListViewModel(context, GetLikeList);
     BoardList          = Context.BoardListVM?.BoardList;
     SelecterVisibility = Visibility.Collapsed;
     CurrentBoardIndex  = -1;
 }
Ejemplo n.º 9
0
 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;
 }
Ejemplo n.º 10
0
		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;
		}
Ejemplo n.º 11
0
        public async override void OnNavigatedTo(HBNavigationEventArgs e)
        {
            var pin = e.Parameter as Pin;

            if (e.NavigationMode == NavigationMode.New)
            {
                IsLoading   = true;
                ImageLoaded = false;
                if (pin?.pin_id != Pin?.pin_id)
                {
                    Pin = await Context.API.PinAPI.GetPin(pin.pin_id);
                }

                PivotSelectedIndex = 0;
                SmallImageUrl      = pin.file.FW236;
                ImageUri           = Pin.file.Orignal;
                //Pin = await App.API.PinAPI.GetPin(pin.pin_id);
                Liked = Pin.liked;
                await BoardListViewModel.ClearAndReload();
            }
        }