Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1320
Overide background for tabitemex header with theme
posted

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

WpfApplication1.zip
Parents
No Data
Reply
  • 2151
    Offline posted

    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>

               

      <igWindows:TabItemEx Header="TabItem3">

        <Grid/>

      </igWindows:TabItemEx>

               

    </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

Children