Exemplo n.º 1
0
        private bool NativeWebView_ShouldStartLoad(UIWebView webView, NSUrlRequest request, UIWebViewNavigationType navigationType)
        {
            if (request.Url.Scheme == WindowExternalNotifyScheme)
            {
                var data = request.Url.AbsoluteString.Substring(WindowExternalNotifyUrlPrefix.Length);

                data = WebUtility.UrlDecode(data);

                this.OnScriptNotify(
                    new NotifyEventArgs()
                    {
                        Value = data
                    });

                return false;
            }

            this.lastLoaded = new Uri(request.Url.AbsoluteString); // TODO: Check this
            var e = new NavigatingEventArgs()
            {
                Uri = this.lastLoaded
            };

            this.OnNavigating(e);

            return !e.Cancel;
        }
Exemplo n.º 2
0
            public override void OnPageStarted(WebView view, string url, Android.Graphics.Bitmap favicon)
            {
                var thid = System.Threading.Thread.CurrentThread.ManagedThreadId;

                var nea = new NavigatingEventArgs();
                nea.Uri = new Uri(url);
                _Parent.OnNavigating(nea);

                if (nea.Cancel)
                {
                    _Parent.NativeWebView.StopLoading();
                    //EnqueueNavigationData(new NavigationData(url, true));
                }
                else
                {
                    base.OnPageStarted(view, url, favicon);
                }
            }
Exemplo n.º 3
0
 /// <summary>
 /// Rises Navigating event
 /// </summary>
 /// <param name="e">Events arguments object to use</param>
 internal void OnNavigating(NavigatingEventArgs e)
 {
     if (this.Navigating != null)
     {
         this.Navigating(this, e);
     }
 }