Esempio n. 1
0
		// Using native PlacePicker Controller
		void PlacePicker ()
		{
			var placeController = new FBPlacePickerViewController () {
				Title = "Pick a place",
				LocationCoordinate = new CLLocationCoordinate2D (37.453827, -122.182187), // Hard code current location to Menlo Park, CA
				RadiusInMeters = 1000, // Configure the additional search parameters
				ResultsLimit = 50,
				SearchText = "Coffee"
			};

			placeController.LoadData ();
			placeController.PresentModallyFromViewController (this, true, (sender, donePressed) => {
				if (!donePressed) 
					InvokeOnMainThread (() => new UIAlertView ("Error", "User canceled.", null, "Ok", null).Show ());
				else {
					var ctrl = sender as FBPlacePickerViewController;

					if (ctrl.Selection == null) {
						InvokeOnMainThread (() => new UIAlertView ("Hey!", "You haven't selected any place...", null, "Ok", null).Show ());
					} else {
						InvokeOnMainThread (() => new UIAlertView ("Success", "You Picked " + ctrl.Selection.GetName(), null, "Ok", null).Show ());
					}
				}
			});
		}