private void Comment_Click(object sender, RoutedEventArgs e) { if (ViewModel.Video != null) { NavigationHelper.DetailFrameNavigate(typeof(CommentPage), ViewModel.Video.DocumentId); } }
/// <summary> /// 跳转到评论页 /// </summary> /// <param name="videoId"></param> public void NavigateToComment(string videoId) { if (!string.IsNullOrEmpty(videoId)) { NavigationHelper.DetailFrameNavigate(typeof(CommentPage), videoId); } }
/// <summary> /// 跳转到评论列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void CommentBtnClick(object sender, RoutedEventArgs e) { if (DocumentExtra != null) { NavigationHelper.DetailFrameNavigate(typeof(CommentPage), DocumentExtra.DocumentId); } }
private void faqBtn_Click(object sender, RoutedEventArgs e) { WebViewParameter paramter = new WebViewParameter() { Title = "如何复制", WebViewUri = "http://dailyapi.ibaozou.com/faq?category_id=1", DisplayType = "3" }; NavigationHelper.DetailFrameNavigate(typeof(WebViewPage), paramter); }
public void videoListView_ItemClick(object sender, ItemClickEventArgs e) { var video = e.ClickedItem as Video; if (video != null) { NavigationHelper.DetailFrameNavigate(typeof(VideoPage), video.DocumentId); } }
private void TaskInfo(object sender, TappedRoutedEventArgs e) { WebViewParameter paramter = new WebViewParameter() { Title = "任务介绍", WebViewUri = "http://dailyapi.ibaozou.com/task_info", DisplayType = "3" }; NavigationHelper.DetailFrameNavigate(typeof(WebViewPage), paramter); }
public void CoinRank() { string uri = string.Format(Http.ServiceUri.MyCoins, DataShareManager.Current.User.AccessToken); WebViewParameter paramter = new WebViewParameter() { Title = "我的金币", WebViewUri = uri, DisplayType = "3" }; NavigationHelper.DetailFrameNavigate(typeof(WebViewPage), paramter); }
public void contributeListView_ItemClick(object sender, ItemClickEventArgs e) { var contribute = e.ClickedItem as Contribute; if (contribute != null) { WebViewParameter parameter = new WebViewParameter() { Title = contribute.Title, DocumentId = contribute.DocumentId, DisplayType = contribute.DisplayType, WebViewUri = contribute.Url }; NavigationHelper.DetailFrameNavigate(typeof(WebViewPage), parameter); } }
public void documentListView_ItemClick(object sender, ItemClickEventArgs e) { var story = e.ClickedItem as Document; if (story != null) { WebViewParameter parameter = new WebViewParameter() { Title = story.Title, WebViewUri = story.Url, DocumentId = story.DocumentId, DisplayType = story.DisplayType }; NavigationHelper.DetailFrameNavigate(typeof(WebViewPage), parameter); } }
private void Button_Click(object sender, RoutedEventArgs e) { Comment comment = ((Button)sender)?.DataContext as Comment; if (comment != null && comment.Article != null) { if (!comment.Article.DisplayType.Equals("3")) { WebViewParameter parameter = new WebViewParameter() { Title = "", DocumentId = comment.Article.DocumentId, DisplayType = "1" }; MasterDetailPage.Current.DetailFrame.Navigate(typeof(WebViewPage), parameter); } else { NavigationHelper.DetailFrameNavigate(typeof(VideoPage), comment.Article.DocumentId); } } }
public void documentListView_ItemClick(object sender, ItemClickEventArgs e) { var document = e.ClickedItem as Document; if (document != null) { if (!document.DisplayType.Equals("3")) { WebViewParameter parameter = new WebViewParameter() { Title = "", WebViewUri = document.Url, DocumentId = document.DocumentId, DisplayType = document.DisplayType }; MasterDetailPage.Current.DetailFrame.Navigate(typeof(WebViewPage), parameter); } else { NavigationHelper.DetailFrameNavigate(typeof(VideoPage), document.DocumentId); } } }
private void voteArticleBtn_Click(object sender, RoutedEventArgs e) { Message message = ((Button)sender)?.DataContext as Message; if (message != null && message.VotedComment != null) { var article = message.VotedComment.Article; if (article != null) { if (!article.DisplayType.Equals("3")) { WebViewParameter parameter = new WebViewParameter() { Title = article.Title, DocumentId = article.DocumentId, DisplayType = "1" }; MasterDetailPage.Current.DetailFrame.Navigate(typeof(WebViewPage), parameter); } else { NavigationHelper.DetailFrameNavigate(typeof(VideoPage), article.DocumentId); } } } }
private static void HttpBaseService_OnUnAuthorized() { NavigationHelper.DetailFrameNavigate(typeof(BaozouLoginPage)); }
public void baozouLoginBtn_Click(object sender, RoutedEventArgs e) { NavigationHelper.DetailFrameNavigate(typeof(BaozouLoginPage)); }
/// <summary> /// 处理Toast通知 /// </summary> /// <param name="args"></param> private void HandleNotification(IActivatedEventArgs args) { // 通过Toast通知从后台打开 if (args is ToastNotificationActivatedEventArgs) { var toastActivationArgs = args as ToastNotificationActivatedEventArgs; string argument = (string)LocalSettings.Values["args"]; QueryString queryString; if (!string.IsNullOrEmpty(toastActivationArgs.Argument)) { queryString = QueryString.Parse(toastActivationArgs.Argument); } else { queryString = QueryString.Parse(argument); } string type = string.Empty; if (!queryString.TryGetValue("type", out type)) { return; } switch (type) { // 首页 case "mainpage": // 投稿 case "contribute": WebViewParameter parameter = new WebViewParameter() { Title = "", WebViewUri = queryString["uri"], DocumentId = queryString["documentId"], DisplayType = queryString["displayType"] }; try { if (MasterDetailPage.Current == null) { Frame rootFrame = Window.Current.Content as Frame; if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter rootFrame.Navigate(typeof(MasterDetailPage), new SlideNavigationTransitionInfo()); } } NavigationHelper.DetailFrameNavigate(typeof(WebViewPage), parameter); } catch (Exception e) { LogHelper.WriteLine(e); } break; // 视频 case "video": try { if (MasterDetailPage.Current == null) { Frame rootFrame = Window.Current.Content as Frame; if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter rootFrame.Navigate(typeof(MasterDetailPage), new SlideNavigationTransitionInfo()); } } NavigationHelper.DetailFrameNavigate(typeof(VideoPage), queryString["documentId"]); } catch (Exception e) { LogHelper.WriteLine(e); } break; } } }