DockableContent Show and Hide

May 16, 2009 at 10:13 PM

Hello

 

At first: sorry for my poor english.

I have this testxaml:

 

<DockPanel>
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="Dockable1 öffnen" Click="Open_Dockable1"/>
            <MenuItem Header="Document1 öffnen" Click="Open_Document1"/>
        </Menu>
        <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:DockablePane>

                <AvalonDock:DocumentPane>
                    <AvalonDock:DocumentContent Title="Document1"></AvalonDock:DocumentContent>
                </AvalonDock:DocumentPane>
                <AvalonDock:DockablePane>
                   
                </AvalonDock:DockablePane>
            </AvalonDock:ResizingPanel>
        </AvalonDock:DockingManager>
    </DockPanel>

 

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.

 

thanks

 

chrische

 

May 17, 2009 at 9: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 12:59 PM

Hello

 

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.

 

Thanks

chrische

May 19, 2009 at 8:01 PM

Hello

 

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.

 

chrische

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

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

Aug 28, 2009 at 6:19 PM

Hi,

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

Aug 28, 2009 at 6:49 PM

you don't need properties for the Show command.

I use only

dockManager.Show(navigator);

where navigator is my DockableContent.

Juergen

Nov 25, 2009 at 3:30 PM

Hi, 

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?

Thanks

Yakoust

 

 

Nov 26, 2009 at 11:00 AM
Edited Nov 26, 2009 at 11:08 AM

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.