public async void LoadMoreTweets() { HomeTlParameters.MaximumNumberOfTweetsToRetrieve = 20; HomeTlParameters.MaxId = Tweets.ElementAt(Tweets.IndexOf(Tweets.Last())).Id; var newTweets = Tweetinvi.Timeline.GetHomeTimeline(HomeTlParameters); if (newTweets != null) { foreach (var tweet in newTweets) { var curTweet = tweet as Tweet; if (curTweet.Id != Tweets.Last().Id) { Tweets.Insert(Tweets.IndexOf(Tweets.Last()) + 1, curTweet); } } await Task.CompletedTask; } else { LoadMoreTweets(); } }
private async void TimelineReloading() { HomeTlParameters.MaximumNumberOfTweetsToRetrieve = 50; HomeTlParameters.SinceId = Tweets.ElementAt(0).Id; var newTweets = Tweetinvi.Timeline.GetHomeTimeline(HomeTlParameters); if (newTweets != null) { foreach (var tweet in newTweets) { var curTweet = tweet as Tweet; Tweets.Insert(0, curTweet); } await Task.CompletedTask; } else { TimelineReloading(); } }