Esempio n. 1
0
        //インフィニットスクロール発動で呼ばれる
        public void Next()
        {
            if (IsEnd)
            {
                return;
            }
            IsActive = true;

            Task.Run(() => {
                var timeline = User.UserInstance.GetUserNicoRepo();

                if (timeline == null)
                {
                    IsEnd    = true;
                    IsActive = false;
                    return;
                }
                foreach (var entry in timeline)
                {
                    UserNicoRepoList.Add(new NicoRepoResultEntryViewModel(entry));
                }

                IsActive = false;
            });
        }
Esempio n. 2
0
 public void Initialize()
 {
     NextPageOffset = "0";
     Closed         = false;
     UserNicoRepoList.Clear();
     GetMore();
 }
Esempio n. 3
0
        public void Initialize()
        {
            IsActive = true;
            Task.Run(() => {
                var timeline = User.UserInstance.GetUserNicoRepo();

                if (timeline == null)
                {
                    if (UserNicoRepoList.Count == 0)
                    {
                        //非公開、又は表示期限切れ
                        Closed = true;
                    }
                    IsActive = false;
                    IsEnd    = true;
                    return;
                }
                foreach (var entry in timeline)
                {
                    UserNicoRepoList.Add(new NicoRepoResultEntryViewModel(entry));
                }

                IsActive = false;
            });
        }
Esempio n. 4
0
        public async void GetMore()
        {
            if (IsActive)
            {
                return;
            }

            IsActive = true;

            //一番最後にあるボタンを消す
            if (UserNicoRepoList.Count > 0)
            {
                UserNicoRepoList.RemoveAt(UserNicoRepoList.Count - 1);
            }

            var timeline = await User.UserInstance.GetUserNicoRepoAsync(NextPageOffset);

            if (timeline == null || timeline.Items.Count == 0)
            {
                //非公開、又は表示期限切れ
                Closed   = true;
                IsActive = false;
                return;
            }
            foreach (var entry in timeline.Items)
            {
                UserNicoRepoList.Add(new NicoRepoResultEntryViewModel(entry));
            }

            NextPageOffset = timeline.NextPage;

            IsActive = false;
            if (!timeline.IsEnd)
            {
                UserNicoRepoList.Add(new NicoRepoNextButtonEntryViewModel(this));
            }
        }