Exemplo n.º 1
0
        /// <summary>
        /// 在新窗口中播放视频
        /// </summary>
        /// <param name="video">视频ID</param>
        /// <param name="cid">分片ID</param>
        public async void PlayVideoSeparate(VideoDetail video, int cid, bool isCloseCurrentPage = true)
        {
            CoreApplicationView newView = CoreApplication.CreateNewView();
            int newViewId = 0;
            await newView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                Frame frame = new Frame();
                frame.Navigate(typeof(MiniPlayerPage), new Tuple <VideoDetail, int>(video, cid));
                Window.Current.Content = frame;
                // You have to activate the window in order to show it later.
                Window.Current.Activate();
                newViewId = ApplicationView.GetForCurrentView().Id;
            });

            bool viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newViewId);

            if (!App._isTabletMode && CurrentPageType == typeof(VideoPage) && isCloseCurrentPage)
            {
                CurrentPagePanel.MainPageBack();
            }
        }