title: Use a UserControl inside a Ribbon
body: <p>I want to use a UserControl inside a RibbonControl.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;RibbonWindow
    xmlns:uc="clr-namespace:UserControl1;assembly=UserControl1"&gt;
  
    &lt;Grid ShowGridLines="False" Margin="0"&gt;
       &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="Auto"/&gt;
          &lt;RowDefinition Height="100*"/&gt;
       &lt;/Grid.RowDefinitions&gt;
       &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="100*"/&gt;
       &lt;/Grid.ColumnDefinitions&gt;
  
       &lt;Ribbon Grid.Row="0"&gt;
          &lt;RibbonApplicationMenu &gt;
            &lt;RibbonApplicationMenuItem x:Name="miExit" ImageSource="Images/large_exit.png" Header="Exit" /&gt;
          &lt;/RibbonApplicationMenu&gt;
          &lt;RibbonTab Header="Test"&gt;
              &lt;uc:RibbonGroups/&gt;
          &lt;/RibbonTab&gt;
       &lt;/Ribbon&gt;
  
       &lt;uc:Content Grid.Row="1" /&gt;
  
    &lt;/Grid&gt;
  
  &lt;/RibbonWindow&gt;
  </code></pre>
  
  <p>You see two UserControls, uc:RibbonGroups and uc:Content. While the second one (uc:Content) works fine, the UserControl inside the RibbonControl won't work.</p>
  
  <p>What i missed? 
  I also try this approach:
  <a href="https://stackoverflow.com/questions/3921934/how-to-set-the-usercontrol-for-ribbon-window-in-wpf">How to set the usercontrol for ribbon window in WPF?</a>
  an set a grid inside the RibbonTab and then the UserControl;</p>
  
  <pre><code>     &lt;Ribbon Grid.Row="0"&gt;
           ...
          &lt;Grid&gt;
          &lt;RibbonTab Header="Test"&gt;
              &lt;uc:RibbonGroups/&gt;
          &lt;/RibbonTab&gt;
          &lt;/Grid&gt;
       &lt;/Ribbon&gt;
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>     &lt;Ribbon Grid.Row="0"&gt;
           ...
          &lt;RibbonTab Header="Test"&gt;
              &lt;uc:RibbonGroups/&gt;
          &lt;/RibbonTab&gt;
       &lt;/Ribbon&gt;
  </code></pre>
  
  <p><strong>Edit:</strong>
  UserControl now only holds the content of RibbonTab, RibbonTab itself moved to the main window</p>
  
  <pre><code>  &lt;UserControl ...&gt;
       &lt;StackPanel Orientation="Horizontal"&gt;
          &lt;RibbonGroup Header="Test" &gt;
               &lt;RibbonButton SmallImageSource="Images/small_save.png"
                             LargeImageSource="Images/large_save.png" /&gt;
          &lt;Image Source="Images/large_expert_enabled.png"&gt;&lt;/Image&gt;
       &lt;/Stackpanel&gt;  
    &lt;/UserControl&gt;
  </code></pre>
  
  <p>RibbonGroup are shown with the Header but without the images, and the separate Image are shown itself. So maybe there are now any suggestions what goes wrong?</p>
  
  <p><strong>EDIT2:</strong>
  If i step into with Snoop, the RibbonButtons and their corresponding images are present.</p>
  
  <p><strong>EDIT3:</strong>
  I tried another way with resources, but same problem as above..
  How it looks, when i have the RibbonTab in the resource/UserControl:
  <a href="http://s12.postimg.org/lpposl48t/DLL_Ribbon_Tab_fail_part.png" rel="nofollow noreferrer">http://s12.postimg.org/lpposl48t/DLL_Ribbon_Tab_fail_part.png</a></p>
  
  <p>How it looks, when i have the RibbonGroup in the resource/UserControl:
  <a href="http://s12.postimg.org/oiiwcm4l9/DLL_Ribbon_Group_fail_part.png" rel="nofollow noreferrer">http://s12.postimg.org/oiiwcm4l9/DLL_Ribbon_Group_fail_part.png</a></p>