QAT: CanCloneToQuickAccessToolBar

Ribbon for WPF Forum

Posted 15 years ago by Brad Leach
Version: 9.1.0503
Avatar
Greetings,

I have quite a number of ContextualTabs in my application. I would like to disallow any item on a ContextaulTab from being added to the QAT. I've played with setting ribbon:CloneService.CanCloneToQuickAccessToolBar = false; but I can't seem to be able to do this on a global scale. I have way to many Contextual Tabs to do this on an individual basis.

It is possible to provide a default style for ribbon buttons, based on a particular Actipro theme? (I could then use this default style for all my contextual tabs with the clone set to false, and simply renable the "CanCloneToQuickAccessToolBar" on my main ribbon items).

I think I might be just overriding the default styles I have created in my resources section . I am using markup like the following:

<Style x:Key="NoQATRibbonButton" TargetType="{x:Type rib:Button}">
    <Setter Property="rib:CloneService.CanCloneToQuickAccessToolBar" Value="False" />
</Style>

...

<Style TargetType="{x:Type rib:Button}" BasedOn="{StaticResource NoQATRibbonButton}" />
...however in my App OnStartup, I am using the following:
ActiproSoftware.Windows.Themes.ThemeManager.CurrentTheme = CommonThemeName.Office2007Black.ToString();
P.s. I also want to disable all "Groups", "SplitButtons" and other controls from being added to the QAT. I am hoping I could reuse the logic for those type of controls.

Thanks,
-Brad

Comments (3)

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

The use of implicit styles as you said may work fine for this. Perhaps you could even put some of the Button-related ones in the ContextualTabGroups' Resources sections so that only Buttons in those get this setting applied? I haven't tested it but in theory that may work.


Actipro Software Support

Posted 15 years ago by Brad Leach
Avatar
Apologies - I seemed to miss typing part of my original question, which would have made deciphering it quite difficult.

I now have a working solution for the default theme of the ribbon, however when I apply the Office2k7Black theme, it overwrites the styles I have set up (which is expected). However, my problem lies in that I don't want to give the user options for themes - we have settled on the Office Black theme, and thus want to set it as the very first time available in our application (App.OnStartup).

Is there anyway to set the "Office Black" theme before the other resource dictionaries are loaded? Usually, I would simply set the style/theme as the first line in my App.xaml; resource dictionaries could load/merge on top.
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Brad,

Resources are loaded in order, so as long as your resources are in the MergedDictionaries collection after ours, you can override our resources.

We're making a change to the upcoming build with ThemeManager. Up until now, it was adding the ResourceDictionary objects it adds to MergedDictionaries to the end of the collection. The problem here is that if you had existing merged dictionaries in your app's resources for example, none of them could override our resources since ours were added after the existing ones. So with this upcoming change, they will be added before instead. Thus you can have a ResourceDictionary of resources in your Application.Current.Resources.MergedDictionaries that will be able to override anything that gets swapped in by our ThemeManager.


Actipro Software Support

The latest build of this product (v24.1.2) was released 8 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.