Showing ApplicationMenu programmatically

Ribbon for WPF Forum

Posted 15 years ago by Mike Berriman
Version: 9.2.0511
Avatar

Hi,

I'm trying to find a way to programmatically display the ApplicationMenu. So basically, without user selection or keypresses, the menu appears in front of them. Basically, I'm trying to provide a "search" function which highlights a button on the ribbon (or in the application menu) - basically showing the user where on the ribbon a particular button is located.

Thanks.

Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Mike,

There's nothing really built-in to do that (i.e. no property or method on Ribbon). But you can search the visual tree to find an instance of ApplicationButton, then set it's IsPopupOpen property. Something like the following:
RibbonWindow ribbonWindow = VisualTreeHelperExtended.GetCurrentOrAncestor(sender as DependencyObject, typeof(RibbonWindow)) as RibbonWindow;
if (null != ribbonWindow) {
    ApplicationButton button = VisualTreeHelperExtended.GetFirstDescendant(ribbonWindow, typeof(ApplicationButton)) as ApplicationButton;
    if (null != button)
        button.IsPopupOpen = true;
}
Hope this helps.


Actipro Software Support

The latest build of this product (v24.1.3) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.