{"id":4569,"date":"2014-03-30T13:33:54","date_gmt":"2014-03-30T13:33:54","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/wpf-contextmenu-in-tabitem-header-collection-of-common-programming-errors\/"},"modified":"2014-03-30T13:33:54","modified_gmt":"2014-03-30T13:33:54","slug":"wpf-contextmenu-in-tabitem-header-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/wpf-contextmenu-in-tabitem-header-collection-of-common-programming-errors\/","title":{"rendered":"Wpf &#8211; Contextmenu in TabItem Header-Collection of common programming errors"},"content":{"rendered":"<p>I wanted to add a contextmenu to a tabitem. But it should only be opened by clicking on the header of the tab. I added the Contextmenu like this:<\/p>\n<pre><code>ContextMenu _contextMenu;\nTabItem _tabItem;\n\/\/Initialize the components\n_tabItem.ContextMenu = _contextMenu;\n<\/code><\/pre>\n<p>Only if you klick on the header of the TabItem, the ContextMenu should be opened.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/cUs1a.png\" \/><\/p>\n<p>But if you klick at another position of the tabItem, it shouldn\u00b4t be displayed.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/gu4pH.png\" \/><\/p>\n<p>I need to do that programmatically during the runtime. A solution in xaml is ok, too.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to add a contextmenu to a tabitem. But it should only be opened by clicking on the header of the tab. I added the Contextmenu like this: ContextMenu _contextMenu; TabItem _tabItem; \/\/Initialize the components _tabItem.ContextMenu = _contextMenu; Only if you klick on the header of the TabItem, the ContextMenu should be opened. But [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4569","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4569"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4569\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}