public AboutPage ()
		{
			NavigationPage.SetHasNavigationBar (this, true);
			Title = "About Evolve";

			// embedded HTML page
//			var source = new HtmlWebViewSource ();
//			source.BaseUrl = "About.html";
//			source.Html = "About.html";

			// a URL is easier
			var source = new UrlWebViewSource ();
			source.Url = "http://xamarin.com/evolve/2013";

			var web = new WebView {
				WidthRequest = 300,
				HeightRequest = 400
			};
			web.Source = source;

			Content = new StackLayout {
				VerticalOptions = LayoutOptions.StartAndExpand,
				Children = {
					web,
				}
			};
		}
        public TitleIXPage()
        {
            // Set Page Title
            Title = "Title IX Rights";

            var source = new UrlWebViewSource ();
            source.Url = "http://knowyourix.org/title-ix/title-ix-the-basics/";
            var webView = new WebView {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Source = source
            };
            webView.Navigating += (object sender, WebNavigatingEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Loading");
            };
            webView.Navigated += (object sender, WebNavigatedEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Done");
            };

            Content = new ContentView {
                Content = new StackLayout {
                    Children = {
                        webView
                    }
                }
            };
        }
		public override void OnPageFinished (Android.Webkit.WebView view, string url)
		{
			var source = new UrlWebViewSource{ Url = url };
			var args = new WebNavigatedEventArgs (WebNavigationEvent.NewPage, source, url, WebNavigationResult.Success);

			Navigated (formsWebView, args);
			base.OnPageFinished (view, url);
		}
예제 #4
0
        void ibeacon_EnteredRange(object sender, IBRangeEventArgs e)
        {
            bool changed = false;
            foreach (IBBeacon beacon in e.Beacons) {
                //update the proximity of the currentbeacon
                if (currentbeacon.UniqueID == beacon.UniqueID) {
                    //changed = currentbeacon.Proximity != beacon.Proximity;
                    currentbeacon.Proximity = beacon.Proximity;
                } else {
                    if (beacon.Proximity < currentbeacon.Proximity || beacon.Proximity == 0) {
                        currentbeacon = beacon;
                        changed = true;
                    }
                }
            }

            #region Inline Data
            //			string str = "<b>" + currentbeacon.ProximityUuid +
            //				"</b> <br/> Proximity: " + currentbeacon.Proximity +
            //				"<br/> Major: " + currentbeacon.Major +
            //				"<br/> Minor: " + currentbeacon.Minor +
            //				"<br/> ID: " + currentbeacon.BeaconId +
            //				"<br/> Accuracy: " + currentbeacon.Accuracy;
            //
            //
            //			Xamarin.Forms.Device.BeginInvokeOnMainThread (() => {
            //				if (changed) {
            //					HtmlWebViewSource wvc = new HtmlWebViewSource ();
            //					wvc.Html = str;
            //					MainWebView.Source = wvc;
            //				}
            //
            //				StatusLabel.Text = str;
            //			});
            #endregion

            #region Sample Data
            string str = "";

            if(currentbeacon.ProximityUuid != null)
            {
                SampleData.Exhibit exhibit = SampleData.Exhibits.Find(o =>
                    currentbeacon.ProximityUuid.ToUpper().EndsWith(o.BeaconUUID.ToUpper()) &&
                    o.BeaconMajor == currentbeacon.Major &&
                    o.BeaconMinor == currentbeacon.Minor
                );

                if(exhibit == null)
                {
                    str = "No Beacons In Range";
                    Xamarin.Forms.Device.BeginInvokeOnMainThread (() => {
                        StatusLabel.Text = str;
                    });
                }
                else
                {
                    str = exhibit.Name + " - " + exhibit.Description;
                    Xamarin.Forms.Device.BeginInvokeOnMainThread (() => {
                        if (changed) {
                            UrlWebViewSource wvs = new UrlWebViewSource();
                            wvs.Url = exhibit.ExternalURL;
                            MainWebView.Source = wvs;
                        }
                        StatusLabel.Text = str;
                    });
                }
            }
            #endregion
        }
        public PoliciesWebPage()
        {
            // Set Page Title
            Title = "Pace Policies";

            var source = new UrlWebViewSource ();
            source.Url = "http://pace.edu/sexual-assault";
            var webView = new WebView {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Source = source
            };
            webView.Navigating += (object sender, WebNavigatingEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Loading");
            };
            webView.Navigated += (object sender, WebNavigatedEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Done");
            };

            Content = new ContentView {
                Content = new StackLayout {
                    Children = {
                        webView
                    }
                }
            };
        }