Esempio n. 1
0
        private async Task <IEnumerable <Pin> > GetPinList(uint startIndex, int page)
        {
            IsLoading = true;

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

            try
            {
                list = await Context.API.UserAPI.GetPins(User?.user_id, MyPinListViewModel.GetMaxPinID());

                foreach (var item in list)
                {
                    item.Width = MyPinListViewModel.ColumnWidth;
                    if (item.file != null)
                    {
                        item.Height = ((MyPinListViewModel.ColumnWidth - 0.8) * item.file.height / item.file.width);
                    }
                }
                return(list);
            }
            catch (Exception ex)
            {
            }
            finally
            {
                IsLoading = false;
            }
            return(list);
        }
Esempio n. 2
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 { }
        }
Esempio n. 3
0
 public override void OnNavigatedFrom(HBNavigationEventArgs e)
 {
     MyPinListViewModel.Clear();
     LikePinListViewModel.Clear();
     FollowingListViewModel.Clear();
     FollowerListViewModel.Clear();
     base.OnNavigatedFrom(e);
 }
Esempio n. 4
0
 public override Size ArrangeOverride(Size finalSize)
 {
     MyPinListViewModel.SetWidth(finalSize.Width);
     LikePinListViewModel.SetWidth(finalSize.Width);
     return(base.ArrangeOverride(finalSize));
 }