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
285
TabPanel Background?
posted
Is it possible to change the background color of the tab header area of the xamTabControl? Similar to the "TabPanel" property of the MS WPF tab control? Thanks.
Parents
No Data
Reply
  • 54937
    Offline posted

    There isn't a TabPanel property on the MS WPF tab control so I assume you means ItemsPanel (which is also available on the xamTabControl since that is defined on the base ItemsControl class). By default the tabcontrol is styled such that the header area doesn't have a background so that the background of the parent elements show through - this is normally what tab controls do. If you need to color that area I can think of a few options:

    * Set the ItemsPanel to a igWindows:TabItemPanel (with bindings for all the appropriate properties - e.g. TabStripPlacement, TabLayoutStyle, etc.). If you want to go this route I can provide an example itemspaneltemplate but this approach will only cover the area beneath the tabs (since the itemspaneltemplate is just the panel that contains the items) and not the area occupied by the tab close button or pre/post tabcontent.

    * Retemplate the xamTabControl. We ship xaml files with the default styles in a folder named DefaultStyles. The element you would want to affect is named the "PART_HeaderArea".

    * Put the tabcontrol into a panel (e.g. DockPanel) and set the Background of that panel.

    I would recommend going with the latter since it is the simplest approach and you don't need to worry about any new properties that may be added in the future to the TabItemPanel (a downside to approach 1) and you don't have to worry about what theme you will be using (a downside to approach 2).

    You may also want to submit a suggestion that we define a brush resource key for this area to allow you to provide a brush to control the color of that area.

Children
No Data