Пример #1
0
        public static void LoadLocalHtml(WebView webView, string path)
        {
            CardStreamUriWinRTResolver resolver = new CardStreamUriWinRTResolver();
            var localUri = webView.BuildLocalStreamUri("HtmlViewer", path);

            webView.NavigateToLocalStreamUri(localUri, resolver);
        }
Пример #2
0
        public void NavigateWebviewToLocalPage()
        {
            TinymceStreamUriWinRTResolver resolver = new TinymceStreamUriWinRTResolver();
            var localUri = webViewControl.BuildLocalStreamUri("HtmlEditor", htmlFilePath);

            webViewControl.NavigateToLocalStreamUri(localUri, resolver);
        }
Пример #3
0
        /// <summary>
        ///     Show local page in cordova view
        /// </summary>
        protected void LoadLocalStartPage()
        {
            WebView browser = GetWebView();
            Uri     url     = browser.BuildLocalStreamUri(StreamResolverKey, _bootConfig.StartPage);

            // Pass the resolver object to the navigate call.
            browser.NavigateToLocalStreamUri(url, new StreamUriResolver());
        }
Пример #4
0
 public void Load(WebView sandboxWebView)
 {
     _sandboxWebView = sandboxWebView;
     _sandboxWebView.NavigationCompleted += _sandboxWebView_NavigationCompleted;
     _sandboxWebView.ScriptNotify        += SandboxWebViewOnScriptNotify;
     _sandboxWebView.NavigateToLocalStreamUri(_sandboxWebView.BuildLocalStreamUri("autc", "/sandbox.html"),
                                              new LocalUriResolver());
 }
Пример #5
0
        public AnnouncementControl()
        {
            this.InitializeComponent();
            var content = Content as FrameworkElement;

            content.DataContext = this;

            var uri = WebView.BuildLocalStreamUri("AZME", "/Html/Rebound/rebound.html");

            WebView.NavigateToLocalStreamUri(uri, new AbstractWebPage.WebViewContainerResolver());
        }
        /// <summary>
        ///     Show local page in cordova view
        /// </summary>
        protected void LoadLocalStartPage()
        {
            WebView browser = GetWebView();
            Uri     url     = browser.BuildLocalStreamUri(StreamResolverKey, _bootConfig.StartPage);

            string relativePath = url.PathAndQuery;

            var appDataUri = new Uri("ms-appx-web://" + relativePath);

            browser.Navigate(appDataUri);
        }
Пример #7
0
 /// <summary>
 ///     Gets called when the monitoring WebView loads an HTML file and
 /// </summary>
 /// <param name="sender">The WebView calling this method</param>
 /// <param name="args">The event arguments</param>
 /// <exception cref="NotSupportedException">Following protocol is not supported for Hybrid requests</exception>
 protected virtual void WebViewOnDomContentLoaded(WebView sender, WebViewDOMContentLoadedEventArgs args)
 {
     if (sender != WebView)
     {
         return;
     }
     if (args.Uri == null)
     {
         throw new NotSupportedException(
                   "NavigateToString is not supported when using WebViewHybridBridge class.");
     }
     if (args.Uri.Scheme == "ms-local-stream")
     {
         PushJavascript();
     }
     else if (args.Uri.Scheme == @"ms-appdata")
     {
         if (CustomUriToStreamResolver == null)
         {
             CustomUriToStreamResolver = new UriToAppDataResolver();
         }
         sender.NavigateToLocalStreamUri(
             sender.BuildLocalStreamUri("WebViewHybridBridge", args.Uri.PathAndQuery), BridgeResolver);
     }
     else if (args.Uri.Scheme == @"ms-appx-web")
     {
         if (CustomUriToStreamResolver == null)
         {
             CustomUriToStreamResolver = new UriToAppxResolver();
         }
         sender.NavigateToLocalStreamUri(
             sender.BuildLocalStreamUri("WebViewHybridBridge", args.Uri.PathAndQuery), BridgeResolver);
     }
     else
     {
         throw new NotSupportedException(
                   "HTTP navigation is not supported when using WebViewHybridBridge class.");
     }
 }