コード例 #1
0
        private void WvLogin_Navigating(object sender, WebNavigatingEventArgs e)
        {
            if (e.Url.Contains("https://xamarin-oidc-sample/redirect"))
            {
                wvLogin.IsVisible = false;

                // parse response
                _authResponse = new AuthorizeResponse(e.Url);

                // CSRF check
                var state = _authResponse.Values["state"];
                if (state != _currentCSRFToken)
                {
                    txtResult.Text = "CSRF token doesn't match";
                    return;
                }

                string decodedTokens = "";
                // decode tokens
                if (!string.IsNullOrWhiteSpace(_authResponse.IdentityToken))
                {
                    decodedTokens += "Identity token \r\n";
                    decodedTokens += DecodeToken(_authResponse.IdentityToken) + "\r\n";
                }

                if (!string.IsNullOrWhiteSpace(_authResponse.AccessToken))
                {
                    decodedTokens += "Access token \r\n";
                    decodedTokens += DecodeToken(_authResponse.AccessToken);
                }

                txtResult.Text = decodedTokens;
            }
        }
コード例 #2
0
        void Handle_Navigating(object sender, Xamarin.Forms.WebNavigatingEventArgs e)
        {
            string val = e.Url;

            Console.WriteLine(val);
            if (val.Contains("https://www.droverrideshare-"))
            {
                Console.WriteLine(val);
                int index    = val.IndexOf('-') + 1;
                int newIndex = val.Length - 5;
                val = val.Substring(index, (newIndex - index));
                Console.WriteLine(val);
            }
        }
コード例 #3
0
        private void WebViewOnNavigating(object sender, WebNavigatingEventArgs args)
        {
            var m = EmaUrlRegex.Match(args.Url);
            if (m.Success)
            {
                args.Cancel = true;
                var pageName = m.Groups[1].Value;
                pageName = WebUtility.UrlDecode(pageName);
                GoTo(pageName);
            }

            if (!args.Cancel)
            {
                args.Cancel = true;
                //open external links in external browser
                _externalBrowserService.OpenUrl(args.Url);
            }
        }
コード例 #4
0
        void webviewNavigating(System.Object sender, Xamarin.Forms.WebNavigatingEventArgs e)
        {
            if (!(e.Url.StartsWith("https://test.nottheonlyone.org")))
            {
                if (!(e.Url.StartsWith("https://platform.twitter.com")))
                {
                    try
                    {
                        var uri = new Uri(e.Url);
                        Launcher.OpenAsync(uri);
                    }
                    catch (Exception)
                    {
                    }

                    e.Cancel = true;
                }
            }
        }
コード例 #5
0
 void Handle_Navigating(object sender, Xamarin.Forms.WebNavigatingEventArgs e)
 {
     overlay.IsVisible = true;
 }
コード例 #6
0
 void Handle_Navigating(object sender, Xamarin.Forms.WebNavigatingEventArgs e)
 {
     activityIndicator.IsRunning = true;
 }
コード例 #7
0
 public void SendNavigating(WebNavigatingEventArgs args)
 {
     Navigating?.Invoke(this, args);
 }
コード例 #8
0
ファイル: Issue2357.xaml.cs プロジェクト: Costo/Xamarin.Forms
		static void WebView_OnNavigating (object sender, WebNavigatingEventArgs e)
		{
			Debug.WriteLine ("OS: " + Device.OS + " Current Url: " + GetSourceUrl (((WebView)sender).Source) + "Destination Url: " + e.Url + " " + DateTime.Now);

			if (e.Url.IsValidAbsoluteUrl ()) {
				var destinationUri = new Uri (e.Url);
				var sourceUri = GetSourceUrl (((WebView)sender).Source);
				if (sourceUri.HasSameHost (destinationUri)) {
					if (destinationUri == sourceUri) {
						//Do nothing. This happens on webview load
						Debug.WriteLine ("WebView_OnNavigating Same URI");
						return;
					}

					//If it reaches here, A link could have been clicked.
					e.Cancel = true;
					Debug.WriteLine ("WebView_OnNavigating Same Host but different Uri");
				} else {
					//if external link is clicked
					Debug.WriteLine ("WebView_OnNavigating, DIfferent Uri, so open in Native Browser");
					e.Cancel = true;
					Device.OpenUri (new Uri (e.Url));    
				}
			}
		}
コード例 #9
0
 void Handle_Navigating(object sender, Xamarin.Forms.WebNavigatingEventArgs e)
 {
     LoadingLabel.IsVisible = true;
 }
コード例 #10
0
 void Handle_Navigating(object sender, Xamarin.Forms.WebNavigatingEventArgs e)
 {
 }
コード例 #11
0
ファイル: WebView.cs プロジェクト: Costo/Xamarin.Forms
		internal void SendNavigating(WebNavigatingEventArgs args)
		{
			EventHandler<WebNavigatingEventArgs> handler = Navigating;
			if (handler != null)
				handler(this, args);
		}
コード例 #12
0
 void webOnNavigating(object sender, Xamarin.Forms.WebNavigatingEventArgs e)
 {
     lblStatus.Text = "Loading...";
 }
コード例 #13
0
		/// <summary>
		/// Called when the webview starts navigating. Displays the loading label.
		/// </summary>
		void webviewNavigating(object sender, WebNavigatingEventArgs e)
		{
			this.labelLoading.IsVisible = true; //display the label when navigating starts
		}
コード例 #14
0
 void LoadingSite(object sender, WebNavigatingEventArgs e)
 {
     this.Title = "Henter " + type + "...";
     //LoadingLabel.IsVisible = true;
 }
コード例 #15
0
 void OnNavigating(object sender, Xamarin.Forms.WebNavigatingEventArgs e)
 {
     WebPageViewModel.IsBusy = true;
     Task.Run(async() => await Progress.ProgressTo(0.9, 1000, Easing.SpringIn));
 }
コード例 #16
0
 void Handle_Navigating(object sender, Xamarin.Forms.WebNavigatingEventArgs e)
 {
     refreshButton.IsVisible    = false;
     loadingIndicator.IsVisible = true;
     loadingIndicator.IsRunning = true;
 }
コード例 #17
0
 void Handle_Navigating(object sender, Xamarin.Forms.WebNavigatingEventArgs e)
 {
     //throw new NotImplementedException();
     xActivityIndicator.IsRunning = true;
 }
コード例 #18
0
 void webView_Navigating(System.Object sender, Xamarin.Forms.WebNavigatingEventArgs e)
 {
     App.curUrl = e.Url;
 }
コード例 #19
0
 void Handle_Navigating(object sender, Xamarin.Forms.WebNavigatingEventArgs e)
 {
     Title = "Loading.....";
 }
コード例 #20
0
		/// <summary>
		/// Called when the webview starts navigating. Displays the loading label.
		/// </summary>
		void webviewNavigating (object sender, WebNavigatingEventArgs e)
		{
			this.labelLoading.IsVisible = true;
		}
コード例 #21
0
 void Handle_Navigating(object sender, Xamarin.Forms.WebNavigatingEventArgs e)
 {
     progressBar.IsVisible = true;
     progressBar.IsRunning = true;
 }