Empty Space

Aug 7, 2008 at 9:46 AM
Thank you very much for AvalonDock project!

1. When the document is closed in DocumentPane, I would like to see empty space (background) instead of document space (like in Visual Studio). Is it possible to change this behaivour? Any hints?
2. How could I get an array of open documents from one of this documents using code? Would you like to write down an example of code?

Thanks for answers,

Simon
Aug 7, 2008 at 10:59 AM

Hi Simon, here are your answers:

1. There are several ways to get it, the simplest one is to add a style trigger to the document pane:

              <ad:DocumentPane x:Name="_documentsHost">
                        <ad:DocumentPane.Style >
                                <Style TargetType="{x:Type ad:DocumentPane}">
                                    <Style.Triggers>
                                        <Trigger Property="HasItems" Value="False">
                                            <Setter Property="Visibility" Value="Hidden"/>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                        </ad:DocumentPane.Style>
            .....
..or you can put the trigger into the default DocumentPane style. I'll do so in next release.

2. Use DockingManager.Documents and  use ContainerPane.GetManager() from inside a DocumentContent-derived class  to get a reference to the manager.

Ado

Aug 7, 2008 at 11:55 AM
If you donload build 1509, issue 1 is automatically fixed by the default style, thanks, ado
Aug 7, 2008 at 1:40 PM

Thank you for your help! I am already using new build 1509.

1. This is much better, except I would like to have different color for DocumentPane and "Empty space". Is it possible?

2. I don't understand how to get a reference to the manager. I didn't understand your answer. It seems that class ContainerPane does not exist. Would you like to explain the problem?

Thanks for help again!

Simon

Aug 7, 2008 at 2:53 PM
1. What do you mean for different color for DocumentPane? the "Empty space" is simply the background of the Window, so use Background property to change its color.
Anyway to change the appearance of AvalonDock controls you have to create a custom style.

2.ContainerPane is a property of ManagedContent from which DocumentContent derives. If you created a DocumentContent-derived class use it to get a reference to DockingManager.
If you instead have a different document class that is set as Content of a DocumentContent use code like this:

(Parent as DocumentContent).ContainerPane.GetManager().Documents->array of open documents

Ado