Setting the minimum width on a RibbonGallery

Ribbon for WPF Forum

Posted 10 years ago by Dave Moran
Version: 12.2.0573
Avatar

I need to fix the minimum width of the RibbonGallery to 4 items, even when there is only one item available. I repopulate the gallery when the user changes selection on a tree, which causes the ribbon bar to be resized and the controls to jump around on the ribbon tab. I can set the MinWidth, but I would need to calculate the size based on the Variant and item sizes etc. Is there an easy way to do this?

Thanks

Dave

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Dave,

Unfortunately not, it is designed to only be as wide as necessary to fit the items so that variants can be applied appropriately (per the ribbon resizing rules).  You would have to set the MinWidth property, as you saw, to get the behavior you want.  The gallery's ItemSize property will be filled in once an item is first measured (once a measure pass occurs).  You could make use of that value to determine which MinWidth to set.


Actipro Software Support

Posted 10 years ago by Dave Moran
Avatar

Thanks for the reply. Is the MinWidth of RibbonGallery the total width? i.e. Do I need to add the width of any border? How can I calculate the size of the border etc?

Dave 

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Dave,

I believe there is a 1px border and then the width of the buttons (which are 15px).


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.