Restyling DocumentPane DocumentContent Tabs

Apr 8, 2009 at 6:51 PM
Hi,

    I've been using AvalonDock for a couple weeks now and it's really great - thanks for sharing it with everyone :).  I've just upgraded my project to the new version and I only needed to make a small tweak to get it up and running again: I moved my startup DockingManager.RestoreLayout() from the Window.Load event to the DockingManager.Load event (I was getting an exception about the docking manager not being fully loaded).

    Anyway, on to my question.  I'd like to be able to make changes to individual tabs (each representing a DocumentContent) in a DocumentPane.  One thing I'd like to be able to do is change the background color of a tab.  From doing some searches on the forum my impression is I need to restyle the DocumentPane control to achieve what I'm after.  I'm relatively new to WPF and haven't had much luck in my attempts so far -- I've only managed to restyle properties that are already easily accessible programmatically.  Basically, I made a new keyed style in the xaml and then in the code applied it when I wanted the change to occur using a DocumentContent's: .ContainerPane.Style = (Style)foo.Resources["myStyleName"];

    As I mentioned though I haven't figured out how to get at anything more than the already exposed control properties.  If anyone could post an example of a custom style that changes a single tab background red I'd greatly appreciate it.  I'd imagine armed with the example, figuring out other minor style tweaks on my own, will be made much easier.