Skip to content

Instantly share code, notes, and snippets.

@emoacht
Created April 9, 2022 15:50
Show Gist options
  • Save emoacht/a0bfdd554406a3f4146f68613b6ed290 to your computer and use it in GitHub Desktop.
Save emoacht/a0bfdd554406a3f4146f68613b6ed290 to your computer and use it in GitHub Desktop.
Get relative position of ContextMenu from target.
public static class ContextMenuHelper
{
public static Point GetRelativePositionFromTarget(this ContextMenu source)
{
return source.TranslatePoint(new Point(0, 0), source.PlacementTarget);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment