Ribbon Custom Panel (dynamic resizing)

Jan 13, 2010 at 11:57 PM

I know how to create custom panels in WPF. I understand in order to get the functionality I want from the Ribbon control I need to create a custom panel and implement the IRibbonControl interface. I tried doing that with a WrapPanel..

 

class RibbonWrapPanel : WrapPanel, IRibbonInterface {}

 

I then put the RibbonWrapPanel in my RibbonGroup like so...

 

<r:RibbonGroup x:Name="ribbonGroup">
     <local:RibbonWrapPanel>
          <Slider x:Name="slider" Width="310" />
	  <Button Content="Button" />
	  <Button Content="Button" />
	  <Button Content="Button" />
	  <Button Content="Button" />
	  <Button Content="Button" />
	  <Button Content="Button" />
     </local:RibbonWrapPanel>
</r:RibbonGroup>

 

I expected my RibbonWrapPanel to resize automatically as the group resizes. But what happens is my Group shows all buttons and slider when the window is very large. Then - instead of sizing smaller as the window sizes smaller, it just snaps to a splitbutton which you have to click to see the slider and buttons.  

So my question is how do I get my custom panel to resize when the ribbon resizes??  Thanks!

-Chris