예제 #1
0
        /// <summary>
        /// Cleans Webpage's content after frame navigates from it.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            VideoUIWebpage.Navigate(new Uri("about:blank"));

            UnloadObject(VideoUIWebpage);
            base.OnNavigatedFrom(e);
        }
예제 #2
0
        /// <summary>
        /// Navigates to the given Video URL and calls tips presentation as soon as the frame navigates to this WebPage.
        /// </summary>
        /// <param name="e">The navigation events, may containing an InformationPayload.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter != null)
            {
                InformationPayload information = (InformationPayload)e.Parameter;

                VideoUIWebpage.Navigate(information.VideoURI);
                Painter.RunUIUpdateByMethod(PresentPage);

                base.OnNavigatedTo(e);
            }
        }
예제 #3
0
        /// <summary>
        /// Navigates to the given Video URL and calls tips presentation as soon as the frame navigates to this WebPage.
        /// </summary>
        /// <param name="e">The navigation events, may containing an InformationPayload.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter != null)
            {
                InformationPayload information = (InformationPayload)e.Parameter;
                CurrentURI = information.VideoURI;
                VideoUIWebpage.Navigate(CurrentURI);

                if ((string)Utils.GetSettingValue(Constants.Settings.ShowTips["varname"]) == Constants.Settings.ShowTips["True"])
                {
                    Painter.RunUIUpdateByMethod(ShowTips);
                }

                base.OnNavigatedTo(e);
            }
        }
예제 #4
0
        /// <summary>
        /// Handles redirects to inside the Webview, displaying the appropiate message an acting based on the redirect URI.
        /// In case of a valid URL selected by user, loads it on VideoUI. Otherwise, warn user about invalid link.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void LinkRedirectHandler(WebView sender, WebViewNewWindowRequestedEventArgs args)
        {
            string redirectUrl = args.Uri.ToString();

            if (Validator.IsMediaURLValid(redirectUrl) == true)
            {
                Frame.Navigate(typeof(WarnPage), new WarnPayload(LangResources.LoadingWarn, typeof(Webpage), 2500));

                VideoUIWebpage.Navigate(Utils.GetProperVideoUIUri(redirectUrl));
            }
            else
            {
                Frame.Navigate(typeof(WarnPage), new WarnPayload(LangResources.InvalidURLWarn, typeof(Webpage), 1500));
            }

            args.Handled = true;
        }