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
105
Style for heads of TabItems for XamTabControl
posted

Hi,

for about 2 hours I try to find out how to "just style the heads" of XamTabControl. 
(I could extend the first sentence with many frustration words, but this isn't constructive.) 

I want to set a brush to the background, foreground (text) and border. For active and inactive tab headers. 
A screenshot (from an Infragistics Forms application) shows an example layout. 


I looked to the example "Customizing the XamTabControl", to the article "About Styling xamTabControl", to forum topics, to the local documentation and to Google. 
Additionally I made experiments with my application. For example I added the following code to my control ressources, but nothing happens:

<SolidColorBrush x:Key="{x:Static igWindows:PrimitivesBrushKeys.TabContentBackgroundFillKey}" Color="Pink" />


So how I can apply such simple styles to the tab headers?

Where can I find an overview of the available keys for XamTabControl in the local documentation?


By the way:
It would be useful when your forum post editor has a feature for "code style" and an image upload service.

Thanks in advance,
Andreas 

Parents
  • 34810
    Offline posted

    Hello Andreas,

    Thank you for your post!

    To find an overview of the available keys for the XamTabControl with respect to the tab headers, I would recommend that you look into the default style for TabItemEx, which is located in the XAML file commonly found at this directory: C:\Program Files (x86)\Infragistics\2015.1\WPF\DefaultStyles\Windows\PrimitivesGeneric.xaml. For styling the background, foreground, and border properties of these tab headers though, I wouldn't really recommend overwriting this keys, since they may be used elsewhere in the application. Instead, I would recommend simply writing a style for TabItemEx and setting the Background, Foreground, and BorderBrush properties.

    The above will work for the inactive tabs in the XamTabControl, but for styling the active tabs, you may want to consider modifying the template of the TabItemEx, as these colors are determined by elements internal to the element's template. I have attached a sample project that demonstrates a way you can modify the template for active and inactive tabs with the XamTabControl.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XamTabControlStylingCase.zip
Reply Children