Hello,
I tried to Change the backgroundcolors of the Office2013 Theme for the XamRibbon.
I Use the XamRibbon in a XamRibbonWindow. I tried to Change the Color with the BrushWasher, whitch work fine for any other themes.
but i like to use the flat style from the Office2013 theme.
Furthermore I try to rebuild the style I've created in the Infragistics AppStylist 2018.1 for forms.
I tried to Change the Transparent KeyColors of the theme, which are created from the ColorTuner. Unfortunaly Nothing happen.
So now i try to Change the WashGroups and the wash Color TabArea.
Hopefully I have to finde the Right WashGroup Name.
But, I guess, the backgrounds a transparent by Default. So I look for the Right theme to change. But where is
"xmlns:themes="">infragistics.com/Themes" saved?
<ribbon:XamRibbonWindow xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WPFWindowHostWF" xmlns:ribbon="http://infragistics.com/Ribbon" xmlns:forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" xmlns:themes="http://infragistics.com/Themes" x:Class="WPFWindowHostWF.MainWindow" mc:Ignorable="d" Title="MainWindow" WindowStyle="None" SizeToContent="WidthAndHeight"> <ribbon:XamRibbonWindow.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <!-- First, import the base theme we are going to wash to ensure the correct ControlTemplates are used--> <!-- Add a ResourceWasher --> <!-- Note: 1. The WashMode property defaults to "SoftLightBlend" but can be set to "HueSaturationReplacement" 2. If the WashColor of an individual WashGroup is not set or is left to its default value of "Transparent" then the resources are not washed --> <themes:ResourceWasher AutoWash="True" WashMode="HueSaturationReplacement" WashColor="Gray" > <themes:ResourceWasher.SourceDictionary> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <themes:RibbonOffice2013/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </themes:ResourceWasher.SourceDictionary> <themes:ResourceWasher.WashGroups> <themes:WashGroupCollection> <!-- Specify WashColors for each WashGroup in the Theme. The WashGroups are the same in all themes. --> <themes:WashGroup Name="TabArea" WashColor="Red"/> <themes:WashGroup Name="Pressed" WashColor="Red"/> <themes:WashGroup Name="BaseColor" WashColor="Red"/> </themes:WashGroupCollection> </themes:ResourceWasher.WashGroups> </themes:ResourceWasher> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </ribbon:XamRibbonWindow.Resources>
Best regards,
Nico
Hello ,
Thank you for posting. XamRibbon is a WPF-specific control and all the WPF-specific controls are in DefaultStyles. so :
Infragistics/2018.1/WPF/DefaultStyles/Ribbon/RibbonOffice2013.xaml is the file you want.
Please let me know if you need further assistance.
Sincerely,
Divya Jain
Associate Software Developer
ok, do you know, which Color i have to Change, to get a gray background color and a green Caption Area?
For gray background color the key is ContainerFillKey and for the tabs green caption are you can use CaptionPanelFillKey and RibbonTabControlHeaderPanelBackgroundKey keys available in the ‘RibbonGeneric.xaml’ file available on the same path.
I override the ‘RibbonTabItem Style’ style.
I am not sure if the ResourceWasher would work in case of transparent default color. So I would recommend you to achieve it by modifying the default style using resource dictionary.
Something like this :
<ig:XamRibbon Theme="Office2013" > <ig:XamRibbon.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="TabItemDictionary.xaml"/> </ResourceDictionary.MergedDictionaries> <SolidColorBrush x:Key="{x:Static igRibbon:RibbonBrushKeys.CaptionPanelFillKey}" Color="Green" /> <SolidColorBrush x:Key="{x:Static igRibbon:RibbonBrushKeys.RibbonTabControlHeaderPanelBackgroundKey}" Color="Green" /> <SolidColorBrush x:Key="{x:Static igRibbon:RibbonBrushKeys.ContainerFillKey}" Color="Gray" /> </ResourceDictionary> </ig:XamRibbon.Resources> <ig:XamRibbon.Tabs> <ig:RibbonTabItem Header="Test1"> <ig:RibbonTabItem.RibbonGroups> <ig:RibbonGroup Caption="Group 1"> <ig:RibbonGroup.Items> <ig:ButtonTool Caption="I'm a ButtonTool"/> </ig:RibbonGroup.Items> </ig:RibbonGroup> </ig:RibbonTabItem.RibbonGroups> </ig:RibbonTabItem> <ig:RibbonTabItem Header="Test2"/> <ig:RibbonTabItem Header="Test3"/> <ig:RibbonTabItem Header="Test4"/> </ig:XamRibbon.Tabs> </ig:XamRibbon>
I have also created a sample application for your reference.
Also for more style or color changes you can simply find the key using snoop.Snoop is very useful such scenario and then find the same key in the default theme file and override it into your ResourceDictionary, as I did.
Ribbon.zip