Hiding Quick Access Toolbar button

Ribbon for WPF Forum

Posted 11 years ago by uran1
Version: 4.5.0480
Avatar
Hi

Is it possible to hide small button with arrow next to QuickAccessToolbar?

If it's not possible, how/where can I add my custom control to render instead of QuickAccessToolbar on RibbonWindow toolbar?

In my sample in popup window I don't want to show Ribbon at all, but I would like to use ribbon styles and Quick Access Toolbar button (but without possibility to customize an hiding menu with "Show Below Ribbon" or "Minimize Ribbon"

What is the best solution in such case?

Can I use class RibbonWindowTitleBarButton. If yes- how to do it? I can find any reference to this class in library code or in samples

Mirek

[Modified at 11/20/2008 01:29 AM]

Comments (3)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Mirek,

Right now the customize button can't be hidden but we'll add a TODO list item for this. You could possibly retemplate the QuickAccessToolBarCustomizeButton class to be an empty template or maybe restyle it to be Visibility of Collapsed. That would probably "hide" it.

Nothing can be substitued for the QAT in the RibbonWindow at this time. Maybe if you make a screenshot mockup of what you are trying to do, we can see if we could possibly accommodate your needs in the future.

The IsMinimizable controls whether the Minimize Ribbon item is there. Show Below Ribbon currently always shows up as long as the Ribbon has a QAT visible (QuickAccessToolBarLocation prop). But also look at the Customizing Context Menus QuickStart. That shows you how you can modify even the Customize QAT menu and remove those and other menu items completely or add your own.

RibbonWindowTitleBarButton is really just a primitive used for the RibbonWindow class. But to use it you can probably just set its Content.


Actipro Software Support

Posted 11 years ago by uran1
Avatar
Hi

Can you tell mew or paste sample code, how can I retemplate QuickAccessToolBarCustomizeButton?

Currently I found solution for hiding customize button but it's fragile for possible changes in future releases

PropertyInfo pi = typeof (Ribbon).GetProperty("QatAbove", BindingFlags.NonPublic | BindingFlags.Instance);
MethodInfo mi = pi.GetGetMethod(true);
QuickAccessToolBar quat = (QuickAccessToolBar) mi.Invoke(ribbon, new object[0]);
if (quat == null)
{
                return;
}

StackPanel stackPanel = (StackPanel) VisualTreeHelper.GetChild(quat, 0);
foreach (object child in stackPanel.Children)
{
                if (child is QuickAccessToolBarCustomizeButton)
                {
                    ((QuickAccessToolBarCustomizeButton) child).Visibility = Visibility.Hidden;
                }
}
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Put this in the Resources of your Window:
<Style TargetType="ribbon:QuickAccessToolBarCustomizeButton">
    <Setter Property="Visibility" Value="Collapsed" />
</Style>


Actipro Software Support

The latest build of this product (v2019.1 build 0681) 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.