示例#1
0
        async Task ExecuteLoadTweetsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Tweets.Clear();
                await TwitterController.GetTweets("熱中症");

                var tweets = TwitterController.GetTweetStatuses();
                foreach (var t in tweets)
                {
                    Tweet tweet = new Tweet();
                    tweet.Id                = t["id"];
                    tweet.Name              = t["user"]["name"];
                    tweet.Created           = t["created_at"];
                    tweet.Text              = t["text"];
                    tweet.Profile_image_url = t["user"]["profile_image_url"];
                    Tweets.Add(tweet);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }