void GetGroupTopicCompleted(object s, DoubanSearchCompletedEventArgs args) { App.GroupTopicViewModel.GetGroupTopicCompleted -= GetGroupTopicCompleted; Deployment.Current.Dispatcher.BeginInvoke(() => { base.SetProgressIndicator(false); if (args.IsSuccess) { contentContainer.Visibility = Visibility.Visible; contentContainer.IsEnabled = true; foreach (var content in App.GroupTopicViewModel.TopicContentList) { TextBlock tb = new TextBlock(); //tb.Width = 445; tb.TextWrapping = TextWrapping.Wrap; tb.Foreground = new SolidColorBrush(Colors.Black); tb.FontSize = (double)App.Current.Resources["PhoneFontSizeMedium"]; tb.Text = content; spContent.Children.Add(tb); } contentContainer.ScrollToVerticalOffset(0); } else { ToastPrompt toast = new ToastPrompt(); toast.Message = args.Message; toast.Show(); } } ); }
private void GetCreateTopicsCompleted(object sender, DoubanSearchCompletedEventArgs e) { App.MyGroupViewModel.GetCreateTopicsCompleted -= GetCreateTopicsCompleted; Deployment.Current.Dispatcher.BeginInvoke(() => { ToggleListBoxBusyStyle(listCreateTopic, false); }); }
protected void LoadCompleted(object s, DoubanSearchCompletedEventArgs e) { foreach (var list in ProgressLLSList) { list.IsBusy = false; } SubjectViewModel.UnRegisteLoadCompleted(LoadCompleted); if (!e.IsSuccess) { ToastPrompt toast = new ToastPrompt(); toast.Message = "加载信息出错,请重试"; toast.Show(); } }
void GetReviewsCompleted(object s, DoubanSearchCompletedEventArgs args) { App.SubjectReviewListViewModel.GetReviewsCompleted -= GetReviewsCompleted; Deployment.Current.Dispatcher.BeginInvoke(() => { if (args.IsSuccess) { App.SubjectViewModel.HaveComments = true; listReview.Visibility = Visibility.Visible; } else { App.SubjectViewModel.HaveComments = false; NavigationService.GoBack(); } ToggleListBoxBusyStyle(listReview, false); }); }
void SearchSubjectViewModel_SearchCompleted(object sender, DoubanSearchCompletedEventArgs e) { App.SearchSubjectViewModel.SearchCompleted -= SearchSubjectViewModel_SearchCompleted; Deployment.Current.Dispatcher.BeginInvoke(() => { base.SetProgressIndicator(false); btnSearch.IsEnabled = true; }); if (e.IsSuccess) { listSearchResult.UpdateLayout(); listSearchResult.Visibility = Visibility.Visible; } else { Deployment.Current.Dispatcher.BeginInvoke(() => { ToastPrompt toast = new ToastPrompt(); toast.Message = "没有搜索到任何信息"; toast.Show(); }); } ToggleListBoxBusyStyle(listSearchResult, false); }
private void GetGroupTopicReviewListCompleted(object sender, DoubanSearchCompletedEventArgs e) { App.GroupTopicViewModel.GetGroupTopicReviewListCompleted -= GetGroupTopicReviewListCompleted; Deployment.Current.Dispatcher.BeginInvoke(() => { if (e.Result != null) { pivotItemGroupTopicReview.Header = "评论(" + int.Parse(e.Result.ToString()).ToString() + ")"; } ToggleListBoxBusyStyle(listGroupTopicReview, false); }); }