See Also: UIMenuController Members
The UIKit.UIMenuController is a singleton object, accessed by UIMenuController.SharedMenuController. It manages the editng menu, which provides options for Cut, Copy, Paste, Select, Select All, and Delete commands. The menu is visually associated with a target rectangle specified by UIMenuController.SetTargetRect. It is the application developer's responsibility to set this target rectangle appropriately before displaying the UIKit.UIMenuController.
The application can add or delete additional menu items using the UIMenuController.MenuItems. The following code, taken from the "Touches Gesture Recognizers" sample shows the code necessary to create a modified context menu:
C# Example
void Setup () { var menuController = UIMenuController.SharedMenuController; var resetMenuItem = new UIMenuItem ("Reset", new Selector ("ResetImage")); var location = gestureRecognizer.LocationInView (gestureRecognizer.View); BecomeFirstResponder (); menuController.MenuItems = new [] { resetMenuItem }; menuController.SetTargetRect (new RectangleF (location.X, location.Y, 0, 0), gestureRecognizer.View); menuController.MenuVisible = true; menuController.Animated = true; imageForReset = gestureRecognizer.View; } ... [Export("ResetImage")] void ResetImage (UIMenuController controller) { var mid = new PointF ((imageForReset.Bounds.Left + imageForReset.Bounds.Right) / 2, (imageForReset.Bounds.Top + imageForReset.Bounds.Bottom) / 2); var locationInSuperview = imageForReset.ConvertPointToView (mid, imageForReset.Superview); imageForReset.Layer.AnchorPoint = new PointF (0.5f, 0.5f); imageForReset.Center =locationInSuperview; UIView.BeginAnimations (null, IntPtr.Zero); imageForReset.Transform = CoreGraphics.CGAffineTransform.MakeIdentity (); UIView.CommitAnimations (); }