private void NeedToDisplayActionMenu(object sender, Point location = default) { if (sender is View view) { //Rect rect = Helper.GetRelativePosition(visualElement, typeof(RelativeLayout)); Rect rect = Popup.GetRectOfView(view); // If sender is not a CustomButtom it means that a long press has been used // We simulate the finger size by a square of 24x24 // And we need to take care of the location too if (!(sender is CustomButton)) { rect.Width = 24; rect.Height = 24; rect.X += location.X; rect.Y += location.Y; } ActionMenuToDisplay.Raise(this, new RectEventArgs(rect)); } }
private void MessageContent_ButtonActionUsed(object sender, EventArgs e) { ActionMenuToDisplay?.Raise(sender, e); }