Esempio n. 1
0
        private async void LoadMoreImple(object obj)
        {
            count++;
            var newList = new WebServiceHelper().GetNewsFeeds(10, count);

            if (newList.Count > 0)
            {
                IsLoadMoreNeed = false;
                Feeds          = new ObservableCollection <NewsFeed>(Feeds.Concat(newList));
            }
            else
            {
                LoadText = "Feed ended";
                await Task.Delay(1500);

                IsLoadMoreNeed = false;
            }
        }
Esempio n. 2
0
        protected override void OnStart()
        {
            if (!stopWatch.IsRunning)
            {
                stopWatch.Start();
            }

            Device.StartTimer(new TimeSpan(0, 0, 30), () =>
            {
                if (stopWatch.IsRunning && stopWatch.Elapsed.Minutes >= defaultTimespan)
                {
                    Device.BeginInvokeOnMainThread(() => {
                        string currentId = BackGroundTaskHelper.Instance.CurrentFeeds[0].title;
                        string recentId  = new WebServiceHelper().GetNewsFeeds()[0].title;
                    });

                    stopWatch.Restart();
                }


                return(true);
            });
        }
Esempio n. 3
0
 public void InitializeFeeds(int pageSize = 10, int page = 1)
 {
     Feeds = new WebServiceHelper().GetNewsFeeds(pageSize, page);
     BackGroundTaskHelper.Instance.CurrentFeeds = Feeds;
 }