It has been several months since I did a solid WPF development (it was transferred from application development to a real team).
From memory, you want to set the ContextMenu property to Border , and then set Border.Background=Transparent . Setting the background to transparency ensures that it will participate in hit detection.
An alternative solution will ensure that the Grid element is stretched horizontally and vertically to fit the container.
...
Also pull ContextMenu as a static resource so that it will be easier to find / change in the future.
Hope this helps (and my memory doesn't let me down).
EDIT: I already answered a similar question in StackOverflow, see my answer on WPF: displaying a context menu for GridView elements . This answer is more complete as it focuses on ListItem .
Dennis
source share