コード例 #1
0
ファイル: VideoPage.xaml.cs プロジェクト: arcsinw/BaoZouDaily
 private void Comment_Click(object sender, RoutedEventArgs e)
 {
     if (ViewModel.Video != null)
     {
         NavigationHelper.DetailFrameNavigate(typeof(CommentPage), ViewModel.Video.DocumentId);
     }
 }
コード例 #2
0
 /// <summary>
 /// 跳转到评论页
 /// </summary>
 /// <param name="videoId"></param>
 public void NavigateToComment(string videoId)
 {
     if (!string.IsNullOrEmpty(videoId))
     {
         NavigationHelper.DetailFrameNavigate(typeof(CommentPage), videoId);
     }
 }
コード例 #3
0
 /// <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);
     }
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        public void videoListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            var video = e.ClickedItem as Video;

            if (video != null)
            {
                NavigationHelper.DetailFrameNavigate(typeof(VideoPage), video.DocumentId);
            }
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
            }
        }
コード例 #9
0
        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);
            }
        }
コード例 #10
0
        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);
                }
            }
        }
コード例 #11
0
        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);
                }
            }
        }
コード例 #12
0
        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);
                    }
                }
            }
        }
コード例 #13
0
 private static void HttpBaseService_OnUnAuthorized()
 {
     NavigationHelper.DetailFrameNavigate(typeof(BaozouLoginPage));
 }
コード例 #14
0
 public void baozouLoginBtn_Click(object sender, RoutedEventArgs e)
 {
     NavigationHelper.DetailFrameNavigate(typeof(BaozouLoginPage));
 }
コード例 #15
0
        /// <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;
                }
            }
        }