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
560
Docked Header Background
posted

Maybe I am just missing it, but I cant seem to change the background of the docked pane header. I can change the foreground and the content pane, but the header background remains grey.

Can someone lead me to how the header background can be changed....XAML or in code doest matter, or maybe a link to an example.

Thanks

SDI

Parents
  • 54937
    Offline posted

    Foreground is an inherited property in WPF so changing that will affect an element and its descendants (unless its set explicitly on the descendants). Background is not an inherited property so setting this on an element (e.g. ContentPane) will affect just the element within its ControlTemplate that is bound to that property. The header area is a separate element - PaneHeaderPresenter - that is within the ContentPane's template and it has its own style. If you want to affect the header then you would either restyle the PaneHeaderPresenter (i.e. put a Style into the ContentPane's Resources that targets the PHP and has a custom Template or has setters for the background for the PHP) or you can look at the default xaml we provide (included in the DefaultStyles directory) and see what brushes are being used to provide the background and then put brushes with those ResourceKeys as the key for the brush into the ContentPane's Resources.

Reply Children