public override void ViewDidLoad () { base.ViewDidLoad (); NavigationItem.LeftBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Cancel); NavigationItem.LeftBarButtonItem.Clicked += (sender, e) => { this.NavigationController.PopViewController(true); }; NavigationItem.RightBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Done); NavigationItem.RightBarButtonItem.Clicked += async (sender, e) => { await SaveCheckin(); }; mapView.DidUpdateUserLocation += (sender, e) => { if (mapView.UserLocation != null) { CLLocationCoordinate2D coords = mapView.UserLocation.Coordinate; UpdateMapLocation(coords); } }; UITapGestureRecognizer doubletap = new UITapGestureRecognizer(); doubletap.NumberOfTapsRequired = 1; // double tap doubletap.AddTarget (this, new ObjCRuntime.Selector("ImageTapped")); imageView.AddGestureRecognizer(doubletap); _dataSource = new LocationsDataSource (this); tableLocations.Source = _dataSource; txtComment.ShouldEndEditing += (tf) => { tf.ResignFirstResponder(); return true; }; }
public override void ViewDidLoad() { base.ViewDidLoad(); NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel); NavigationItem.LeftBarButtonItem.Clicked += (sender, e) => { this.NavigationController.PopViewController(true); }; NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done); NavigationItem.RightBarButtonItem.Clicked += async(sender, e) => { await SaveCheckin(); }; mapView.DidUpdateUserLocation += (sender, e) => { if (mapView.UserLocation != null) { CLLocationCoordinate2D coords = mapView.UserLocation.Coordinate; UpdateMapLocation(coords); } }; UITapGestureRecognizer doubletap = new UITapGestureRecognizer(); doubletap.NumberOfTapsRequired = 1; // double tap doubletap.AddTarget(this, new ObjCRuntime.Selector("ImageTapped")); imageView.AddGestureRecognizer(doubletap); _dataSource = new LocationsDataSource(this); tableLocations.Source = _dataSource; txtComment.ShouldEndEditing += (tf) => { tf.ResignFirstResponder(); return(true); }; }