Bars / Ribbon Popup

Bars for WPF Forum

Posted 6 months ago by Blake Pell
Version: 24.1.3
Platform: .NET 6.0
Environment: Windows 11 (64-bit)
Avatar

I have a feature in most of my apps that allows a person to switch between a (Bars) Ribbon and Menu navigation which toggles the visibility on either of those controls.  This works as expected when the Ribbon is not collapsed.  When the Ribbon is collapsed for space, clicking the Ribbon tab opens a popup (I think) of the that Ribbon tab (and when I select menu navigation from there on the Ribbon the Ribbon itself disappears as expected but the popup stays open until something else on the UI is clicked on).

I've tried setting `IsCollapsed` and `IsMinimized` to true.  There is a `IsMinimizedPopupOpen` property but it's a got a private setter.  As a workaround I used reflection to set that private setter on `IsMinimizedPopupOpen` which worked.

var propertyInfo = typeof(Ribbon).GetProperty("IsMinimizedPopupOpen", BindingFlags.Public | BindingFlags.Instance);
propertyInfo?.SetValue(win.Ribbon, false);

My question, is there a correct way to hide that bars Ribbon popup programatically or via XAML that I'm missing or should be using?

Thank you!

[Modified 6 months ago]

Comments (2)

Answer - Posted 6 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Blake,

One thing you could do instead is set Ribbon.IsMinimized = false.  That logic calls into the method that closes the minimized popup.

Or alternatively, you could possibly try dispatching the mode switch so that the ribbon has time to close the popup before it gets hidden.

Are you simply setting Ribbon.Visibility here to hide the ribbon control?


Actipro Software Support

Posted 6 months ago by Blake Pell
Avatar

Setting the Ribbon.IsMinimized to false did the trick!  Thank you, much appreciated.

The latest build of this product (v24.1.5) 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.