This project is read-only.

DockableContent Show and Hide

May 16, 2009 at 11:13 PM



At first: sorry for my poor english.

I have this testxaml:


        <Menu DockPanel.Dock="Top">
            <MenuItem Header="Dockable1 öffnen" Click="Open_Dockable1"/>
            <MenuItem Header="Document1 öffnen" Click="Open_Document1"/>
        <AvalonDock:DockingManager x:Name="dockManager">
            <AvalonDock:ResizingPanel DockPanel.Dock="Bottom">
                <AvalonDock:DockablePane AvalonDock:ResizingPanel.ResizeWidth="100" x:Name="dockablePane1">
                    <Wins:Dockable1 x:Name="dockable1"></Wins:Dockable1>

                    <AvalonDock:DocumentContent Title="Document1"></AvalonDock:DocumentContent>


I want to show the dockable1 at first and when the user "close" it he can open it again with the menu. This is the function "Open_Dockable1":

private void Open_Dockable1(object sender, RoutedEventArgs e)
            dockManager.Show(dockable1, DockableContentState.Docked, AnchorStyle.Left);


If i try it this way the width of dockable1 is 0 and the user must resize the dockable1 with the mouse. I want to set the width per code or use the last width.

What's my problem.






May 17, 2009 at 10:13 AM

Try to add functions OnHide and save the property AvalonDock:DockablePane AvalonDock:ResizingPanel.ResizeWidth and OnShow and restore this value in this function. May be it helps you

May 17, 2009 at 1:59 PM



Thanks for your answer, but i don't understand, what you mean. At first i don't know, which event is fired if the dockablecontent were hide and the second problem is, that i don't know, what property you mean.




May 19, 2009 at 9:01 PM



Okay, i try now this way:


 private void Open_Dockable1(object sender, RoutedEventArgs e)
            var dockWin = new Dockable1();
            ResizingPanel.SetResizeWidth(dockWin, new GridLength(200));
            dockManager.Show(dockWin, DockableContentState.Docked, AnchorStyle.Left);


but the behavior is still the same.



Aug 28, 2009 at 5:45 PM
Edited Aug 28, 2009 at 6:48 PM

Hi, I'm having the extact same problem, got latest code from svn, compile, problem fixed.

Aug 28, 2009 at 7:19 PM


Try giving all your DocumentPanels, DocumentContents and Document Panes a name (x:Name=).

Aug 28, 2009 at 7:49 PM

you don't need properties for the Show command.

I use only


where navigator is my DockableContent.


Nov 25, 2009 at 4:30 PM


As chrische, I first apologie for my poor English.

My problem is related : 

Two of my DockableContent are contained in a ResizePanel at bottom of the main window (one on the left side, one on the right side).

I catch closing event of the DockableContent with StateChanged Event  (HideOnClose = true)

When user wants to open the previously closed DockableContent I call  : MyDockManager.Show(myDockableContentRight);

My problem is that "myDockableContentRight" is docked at the bottom of the window, under the DockableContent who was originally at the left side of "myDockableContentRight"

An issue?





Nov 26, 2009 at 12:00 PM
Edited Nov 26, 2009 at 12:08 PM

Hi all!!!

At first, thanks to adospace for this new library!

I don't speak English very well, therefore sorry for my English.

When I hide DockableContent using DockingManager.Hide() method and then show it again with DockingManager.Show() the position of DockableContent is not the same with position that was before hiding. So, how can I save the position and then restore it when a show DockableContent again?

Thank you for any answers!!!

P.S. I used in my project WeifenLuo docking library. Programmers that use this library don't care about this problem. In WeifenLuo when docking window is shown again library restores it's previous position.