Need DockableContent set to AutoHide at Startup

Nov 24, 2010 at 12:06 PM

Doesn't look like these discussions are monitored as much as they used to be but thought I'd try anyway.

I want all my DockableContent panes to start out at window load time in AutoHide mode (all tabs closed docked to left or right whatever the case might be). So, it looked like doing the below  in the XAML for each one would do the trick but it doesn't. Any advice?

DockableStyle="AutoHide"

 

 

Dec 8, 2010 at 11:21 AM
I have the same problem, someone could do?
Jan 3, 2011 at 3:43 PM

Tackling the same issue this morning.  Tried playing with all the properties and either the panel disappears completely, or nothing happens.  However when you save the current window state and reload it you can achieve the layout you want.

Which then comes the hack until someone else can come up with something better.  

1.) Layout your windows exactly how you want them

2.) Save the layout

3.) On application startup restore the layout by creating the file and loading your layout from there or create a stream and load that way.

If anyone has any better ideas please post.  This should get people up and running in the meantime.

Jan 5, 2011 at 10:24 AM

I used the following command in the loaded event:

            // set the dockable containers into AutoHide
            foreach (DockableContent content in dockManager.DockableContents)
            {
                AvalonDock.DockablePane containerPane = content.ContainerPane as AvalonDock.DockablePane;
                if (containerPane != null)
                {
                    containerPane.ToggleAutoHide();
                }              
            }

Unfortunately I've a bounded listview with an observablecollection that I will fill later on, but I won't get it refreshed.

Jan 6, 2011 at 2:23 PM

I tried that numerous times no avail.  It could be a conflict between the Fluent Ribbon and AvalonDock in my case.   I have a dockable pane on the left side with 2 children, and a document pane with two children taking up a majority of the screen.  When I try to use the ToggleAutoHide in the loaded event nothing happens.  Loading from a file always works for me though.  Would prefer to use the method frankvandenbergh pointed out but right now I cannot.

Jan 6, 2011 at 7:18 PM

The ToggleAutoHide works here. The binding problem is solved thanks to another thread: http://avalondock.codeplex.com/Thread/View.aspx?ThreadId=223961

I've a UserControl that contains about this:

 <Grid>
        <ad:DockingManager x:Name="dockManager">
            <ad:ResizingPanel Orientation="Horizontal">
                <ad:DockablePane>                   
                    <ad:DockableContent>
...

In my main window I have the following:

<ad:DockingManager x:Name="dockManager">
            <ad:ResizingPanel Orientation="Horizontal">
                <ad:DocumentPane>                    
                    <ad:DocumentContent Title="Chart" Name="docChart" IsCloseable="False" />
...
In the loading of the main window I set the content, eg docChart.Content = chartWindow; (= the UserControl).

Jun 1, 2012 at 8:33 PM

Anyone figure away around this. It seems like autohiding programatically (by default) should be fairly straightforward. However, I've had no luck after spending a couple hours trying to find a workaround.

dockManager.Show(somePane, DockableContentState.AutoHide, AnchorStyle.Bottom);

That line actually got the tabs to be autohide, however when I clicked the tabs, it would not display the pane, lol go figure.

 

Thanks.