private async Task StartLoadingPrevTweets() { Status status = DisplayTweet.Model; IsLoadingPrevious = true; while (true) { if (status.InReplyToStatusID == 0) { break; } var inReplyTo = await Context.Twitter.Statuses.GetTweet(status.InReplyToStatusID, true); if (inReplyTo == null) { break; } var vm = new StatusViewModel(inReplyTo, Context, Configuration, ViewServiceRepository); await Dispatcher.RunAsync(() => PreviousConversationTweets.Insert(0, vm)); RaisePropertyChanged(nameof(PreviousConversationTweets)); status = inReplyTo; } await Task.WhenAll(PreviousConversationTweets.Select(s => s.LoadQuotedTweet())); IsLoadingPrevious = false; }
public async Task OnLoad(object data) { if (DisplayTweet == null) { Close(false); return; } PreviousConversationTweets.Clear(); FollowingConversationTweets.Clear(); await Task.WhenAll(StartLoadingPrevTweets(), StartLoadingResponses(), StartLoadingRetweets(), DisplayTweet.LoadQuotedTweet()); }
public async Task OnLoad(object data) { if (DisplayTweet == null) { Close(false); return; } PreviousConversationTweets.Clear(); FollowingConversationTweets.Clear(); await Task.WhenAll(StartLoadingPrevTweets(), StartLoadingResponses(), StartLoadingRetweets(), DisplayTweet.LoadDataAsync()).ContinueWith(async t => { await Dispatcher.RunAsync(Center); }); }