// Pick Place button handler partial void pickPlaceClick(NSObject sender) { Console.WriteLine("pickPlaceClick"); FBPlacePickerViewController placePickerController = new FBPlacePickerViewController(); placePickerController.Title = @"Pick a Seattle Place"; placePickerController.LocationCoordinate = new CLLocationCoordinate2D(47.6097, -122.3331); placePickerController.LoadData(); placePickerController.PresentModally(this, true, delegate(FBViewController sender2, bool donePressed) { if (!donePressed) { return; } //FBGraphObject place = placePickerController.Selection.ObjectForKey(new NSString("name")).ToString() UIAlertView alert = new UIAlertView(@"You Picked:", placePickerController.Selection.ObjectForKey(new NSString("name")).ToString(), null, @"Ok", null); alert.Show(); }); }
// 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 ()); } } }); }
public override void ViewDidUnload() { base.ViewDidUnload (); // Clear any references to subviews of the main view in order to // allow the Garbage Collector to collect them sooner. // // e.g. myOutlet.Dispose (); myOutlet = null; NSNotificationCenter.DefaultCenter.RemoveObserver(this); friendPickerController = null; placePickerController = null; imagePicker = null; ReleaseDesignerOutlets (); }