Hi,
I am trying to override the background color of a tabitemheader for a tabcontrol which uses a theme. Unfortunately this doesn't seem to work.
I followed the example in http://ko.infragistics.com/community/blogs/andrew_smith/archive/2009/12/09/common-style-issues-when-using-the-theme-property.aspx but if I use the BasedOn property the theme doesn't seem to get overriden and if I don't use it I lose the complete theme styling.
Example project in attachement
Hello pvdbpvdb,
You can use the following brush definitions to change the color of a tab item in normal state, mouse hovered state and selected state. Please note that specially for the “Office2k7Silver” theme the normal state does not have any container using the normal state key and this specific brush will not have any effect. This is just how the theme is created. For example if you are using the “IGTheme” there will be difference.
<igWindows:XamTabControl Theme="Office2k7Silver">
<igWindows:XamTabControl.Resources>
<SolidColorBrush Color="Green" x:Key="{x:Static igWindows:PrimitivesBrushKeys.TabItemNormalTopCenterFillKey}" />
<SolidColorBrush Color="Red" x:Key="{x:Static igWindows:PrimitivesBrushKeys.TabItemIsSelectedTopCenterFillKey}" />
<SolidColorBrush Color="Cyan" x:Key="{x:Static igWindows:PrimitivesBrushKeys.TabItemHottrackTopCenterFillKey}" />
</igWindows:XamTabControl.Resources>
<igWindows:TabItemEx Header="TabItem1">
<Grid />
</igWindows:TabItemEx>
<igWindows:TabItemEx Header="TabItem2">
<Grid/>
<igWindows:TabItemEx Header="TabItem3">
</igWindows:XamTabControl>
If you want to change the color of the tab items’ area you can use the following brush:
<SolidColorBrush Color="Green" x:Key="{x:Static igWindows:PrimitivesBrushKeys.TabControlTabStripCenterFillKey}" />
There is also some additional information on a similar question here:
http://ko.infragistics.com/community/forums/t/41505.aspx
Sincerely,
Radko
Senior Software Developer
Added difficulty would be that I need to change the background only one one specific tabheader and only in certain conditions. I was planning to do this with a datatrigger and as far as i know it is impossible to change a brush definition in a datatrigger with the setter property.