{"id":5462,"date":"2014-03-30T22:21:24","date_gmt":"2014-03-30T22:21:24","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/building-wpf-ribbon-at-runtime-collection-of-common-programming-errors\/"},"modified":"2014-03-30T22:21:24","modified_gmt":"2014-03-30T22:21:24","slug":"building-wpf-ribbon-at-runtime-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/building-wpf-ribbon-at-runtime-collection-of-common-programming-errors\/","title":{"rendered":"Building wpf Ribbon at runtime-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to databind a ribbon control for dynamic menus.<\/p>\n<pre><code>\n   \n    \n    \n     \n     \n    \n\n<\/code><\/pre>\n<p>The top ribbon tab is my &#8216;real&#8217; ribbontab. The bottom started out as a manually built that I am verifying my theories with.<\/p>\n<p>Here are the datatemplates I am trying to use:<\/p>\n<pre><code>\n   \n\n\n\n   \n\n<\/code><\/pre>\n<p>This is my first attempt at the Group DataTemplate:<\/p>\n<pre><code>\n   \n\n<\/code><\/pre>\n<p>Then I was trying this one:<\/p>\n<pre><code>\n  \n\n<\/code><\/pre>\n<p>The problem is that I cant get the buttons to show up under the group. If I dont have a grouptemplate as in my second ribbontab, I can get it working. But if I try to do the group dynamically as well it fails to create the buttons. Also by doing the datatemplate with the ribbongroup inside of it, the headings get cutoff. I already read about that and that was the reason for trying to use the HierarchicalDatatemplate. The Regular Datatemplate does not allow for itemsource or itemtemplate.<\/p>\n<p>So How do i get a dynamic RibbonGroup to show Dynamic RibbonButtons?<\/p>\n<p>I have implemented some other changes now and its at least filling it in, however its not correct.<\/p>\n<p>Right now it looks like this: <img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/W5w65.png\" \/><\/p>\n<p>I want it to look like this which is partially hardcoded. <img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/hZP2P.png\" \/><\/p>\n<p>here is the xaml<\/p>\n<pre><code>\n   \n\n\n\n   \n\n<\/code><\/pre>\n<p>the only thing I have left to try is changing my RibbonButtonDataTemplate to a hierarchical datatemplate.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am trying to databind a ribbon control for dynamic menus. The top ribbon tab is my &#8216;real&#8217; ribbontab. The bottom started out as a manually built that I am verifying my theories with. Here are the datatemplates I am trying to use: This is my first attempt at the Group DataTemplate: Then I was [&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-5462","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5462","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=5462"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5462\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}