Hi,
We've been looking into using the XamRibbon and XamRibbonWindow and we have a couple of questions on how to do some things with that control.
Is there an easy way to change the color of the titlebar background?
Also is there a way to add our companies logo to the titlebar and have it appear to the left of the minimize button.
Thanks for any help with this.
Mike
Hello Michael,
There is no built-in way. You would have to retemplate our default styles which are located here:
C:\Program Files (x86)\Infragistics\202x.x\WPF\DefaultStyles\Ribbon
This was previously asked here:www.infragistics.com/.../colorised-the-window-title-bar-of-a-xamribbonwindow
Thank you for this information. I'll take a look at the content template and the post.
It's too bad that you guys don't give us access to those default styles without retemplating the control.
If we created our own Infragistics theme and applied it to the XamRibbon control could we then change the titlebar color without retemplating? Or do we have to retemplate no matter what?
I get that for our companies logo we would have to retemplate but just curious about changing the background color of the title bar using a custom theme.
Check the output window if it mentions as issue with the x:Key. Sounds like the resource is not in scope for the rest of the application to see. The first place you can try is App.xaml, which can be used as a central hub for all your files to inherit from.
eg.
https://docs.microsoft.com/en-us/dotnet/desktop/wpf/app-development/how-to-use-an-application-scope-resource-dictionary?redirectedfrom=MSDN&view=netframeworkdesktop-4.8
It was probably working in MainWindow because the Ribbon is overriding it and the style is actually a local resource embedded directly.
Thanks for all the help so far I've got most everything working like we want except one last thing.
I need to change the color of the QuickAccessToolbar drop down toggle button in the ribbonwindow titlebar. I've looked through the styles but for some reason I'm not able to find the right one.
Can you let tell me which contenttemplate or style I can use to change the color?
EDITED: Actually there is something else as well. I need to know where the trigger is for IsMouseOver for the QAT drop down toggle so I can change the foreground to the dark color we use when the mouse is over it.
Thanks for any help.
Please refer to the sample attached. In MainWindow.xaml at lines 470, changes the background for the dropdown button, and 318 for the styling the arrow.
3730.XamRibbonWindowTheme.zip
Thanks for this example. I'll take a look at it and let you know.
Sorry for not getting back to you sooner. I've got the dropdown button working the way I want. Thanks for the help.
My apologies but another question has come up.
How do I increase the text and image size of the Header of an ApplicationMenu2010Item? I think the ControlTemplate to use for that is this
<ControlTemplate TargetType="igRibbon:ApplicationMenu2010Item" x:Key="{x:Static igRibbon:ApplicationMenu2010Item.ButtonTemplateKey}">
However, for some reason no matter what I do to that template I'm not able to increase the size of the text or the image I want to show. Obviously, I'm missing something but I can't figure out what that might be.
Any ideas?
Thank you for being patient and I am glad I was able to assist.
This was just what I needed. I don't have any other questions right now. Thank you for all your help and direction in helping me solve these issues. It is greatly appreciated.
Thanks I'll give it try and will let you know.
In the sample I provided you should see a Style targeting ApplicatinMenu2010Item on line 7179. There you can add Setters for Header and FontSize.
<Style TargetType="igRibbon:ApplicationMenu2010Item"> <Setter Property="Header"> <Setter.Value> <TextBlock Margin="5,0,0,0" Text="Just a button" /> </Setter.Value> </Setter> <Setter Property="FontSize" Value="25"/> <Setter Property="Background" Value="Transparent" /> <Setter Property="Template" Value="{DynamicResource {x:Static igRibbon:ApplicationMenu2010Item.ButtonTemplateKey}}" /> <Style.Triggers> <Trigger Property="ItemType" Value="Tab"> <Setter Property="Template" Value="{DynamicResource {x:Static igRibbon:ApplicationMenu2010Item.TabTemplateKey}}" /> </Trigger>
<!-- Do not show the default focus for buttons - only for the tabs --> <Trigger Property="ItemType" Value="Button"> <Setter Property="FocusVisualStyle"> <Setter.Value> <Style /> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style>