public void Show(Xwt.Popover.Position orientation, Xwt.Widget referenceWidget, Xwt.Rectangle positionRect, Xwt.Widget child) { popover = MakePopover(child, BackgroundColor); ViewBackend backend = (ViewBackend)Toolkit.GetBackend(referenceWidget); var reference = backend.Widget; // If the position rect is empty, the coordinates of the rect will be ignored. // Width and Height of the rect must be > Epsilon, for the positioning to function correctly. if (Math.Abs(positionRect.Width) < double.Epsilon) { positionRect.Width = 1; } if (Math.Abs(positionRect.Height) < double.Epsilon) { positionRect.Height = 1; } popover.Show(positionRect.ToCGRect(), reference, ToRectEdge(orientation)); }
public void Show (Xwt.Popover.Position orientation, Xwt.Widget referenceWidget, Xwt.Rectangle positionRect, Xwt.Widget child) { popover = MakePopover (child, BackgroundColor); popover.Delegate = new PopoverDelegate (sink); ViewBackend backend = (ViewBackend)Toolkit.GetBackend (referenceWidget); var reference = backend.Widget; // If the position rect is empty, the coordinates of the rect will be ignored. // Width and Height of the rect must be > Epsilon, for the positioning to function correctly. if (Math.Abs (positionRect.Width) < double.Epsilon) positionRect.Width = 1; if (Math.Abs (positionRect.Height) < double.Epsilon) positionRect.Height = 1; positionRect = new Rectangle(positionRect.X, positionRect.Y, positionRect.Width * 2, positionRect.Height); //It appears to be necessary to multiply the width by a factor of 2 popover.Show (positionRect.ToCGRect (), reference, ToRectEdge (orientation)); }