private void replyButtom_Click(object sender, RoutedEventArgs e) { tweetImage1.Source = null; tweetImage2.Source = null; tweetImage3.Source = null; tweetImage4.Source = null; tweetStackPanel.Visibility = Visibility.Hidden; var item = this.listView.SelectedItem as TweetClass.TweetInfo; if (item == null) { return; } else { tweet = new List <TweetClass.TweetInfo>(); //var data = new Tweets(); ReplyId = item.Id; replyBox.Text = item.ScreenName + " "; replyStackPanel.Visibility = Visibility.Visible; tweet = data.replytweetinfo(item); replyView.ItemsSource = tweet; if (item.urls != null) { urlView.ItemsSource = item.urls; } if (item.media != null) { int media_num = item.media.Length; //var media = item.media; //int test = media.Length; //replyBox.Text = item.media_number.ToString(); for (int n = 0; n < media_num; n++) { BitmapImage imageSource = new BitmapImage(item.media[n].MediaUrl); switch (n) { case 0: tweetImage1.Source = imageSource; break; case 1: tweetImage2.Source = imageSource; break; case 2: tweetImage3.Source = imageSource; break; case 3: tweetImage4.Source = imageSource; break; } } } replyBlock.Text = "Reply to " + item.ScreenName; } }