Search code examples
c#wpfavalondock

How to fill AvalonDock 2.0 application only with AnchorableWindows - no DocumentPane


I simply would like to fill AvalonDock application only with "Tool" windows without any document. I can manually minimize the documentpane area but if possible, I would like to fill that small area with another anchorable window so that LayoutDocumentPane's width and height are zero.

Problem from AvalonDock framework's assumption there is at least single empty DocumentPane becomes apparent in my case. Even though there is no document, the emptry space of DocumentPane is easily overlapped or underlapped by other tool windows near it. This makes some window partly invisible or under-filled.

What I tried in vain so far:

  1. Removed LayoutDocumentPane tag from DockManager declaratrion
  2. Set DockWidth and DockHeight of LayoutDocumentPane to zero
  3. Manually minimized DocumentPane and serialize the layout

Any clue will be appreciated


Solution

  • There seems like no way to do this except for changing source code. In CollectGarbage method of LayoutRoot.cs, I commented out following code and got what I wanted - AvalonDock application without any DocumentPane. If there is really no method for this, I highly suggest the author have an option for this without modifying source. Hope it helps others like me.

                    if (emptyPane is LayoutDocumentPane &&
                        this.Descendents().OfType<LayoutDocumentPane>().Count(c => c != emptyPane) == 0)
                        continue;