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; }
private async Task LoadQuotedTweet() { var quoteId = ExtractQuotedTweetUrl(); if (quoteId != 0) { var quoted = await Context.Twitter.Statuses.GetTweet(quoteId, true); if (quoted != null) { QuotedTweet = new StatusViewModel(quoted, Context, Config, ViewServiceRepository); } } }
public void SetReply(StatusViewModel status, bool toAll) { InReplyTo = status; ReplyToAll = toAll; }