{"description":"stackoverflow.com The ContextMenu isn't in the same part of the Visual Tree so that's why you can't use ElementName etc. to reference the DataGrid. You'll have to use PlacementTarget of the ContextMenu instead. WPF\u306eXAML\u306e\u30d3\u30b8\u30e5\u30a2\u30eb\u30c4\u30ea\u30fc\u306e\u4e2d\u306b\u53f3\u30af\u30ea\u30c3\u30af\u30e1\u30cb\u30e5\u30fc\u304c\u542b\u307e\u308c\u3066\u306a\u3044\u306e\u3067\u3001CommandParamter\u306b\u8981\u7d20\u540d(ElementName)\u3092\u6307\u5b9a\u3057\u3066\u3082\u52d5\u304d\u307e\u305b\u3093\u3088\u3001\u3068\u3044\u3046\u8a71\u3089\u2026","title":"DataGrid\u306eContextMenu\u3067UIElement\u304c\u53d6\u5f97\u3067\u304d\u306a\u3044\u554f\u984c","provider_name":"Hatena Blog","height":"190","blog_title":"Life is Really Short, Have Your Life!!","provider_url":"https://hatena.blog","url":"https://aroundthedistance.hatenadiary.jp/entry/2015/12/08/130351","author_url":"https://blog.hatena.ne.jp/gothedistance/","categories":["C#","WPF"],"blog_url":"https://aroundthedistance.hatenadiary.jp/","type":"rich","published":"2015-12-08 13:03:51","author_name":"gothedistance","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Faroundthedistance.hatenadiary.jp%2Fentry%2F2015%2F12%2F08%2F130351\" title=\"DataGrid\u306eContextMenu\u3067UIElement\u304c\u53d6\u5f97\u3067\u304d\u306a\u3044\u554f\u984c - Life is Really Short, Have Your Life!!\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","image_url":null,"version":"1.0"}