How to hide a nested ToolWindowContainer in XAML

Docking/MDI for WPF Forum

Posted 4 years ago by Rick - Developer, Visual Software Systems LLC
Version: 14.2.0611
Avatar

I can't for the life of me figure out how to hide a nested ToolWindowContainer via XAML.  Here's a code sample with three ToolWindows, twOne, twTwo, and twThree, where I have twTwo and twThree in their own container nested within the container for twOne.  I want twTwo and TwThree hidden (e.g. collapsed to the left side of the screen) upon application start up.

        <docking:DockSite x:Name="dockSite" >
            <docking:DockSite.AutoHideBottomContainers>
                <docking:ToolWindowContainer >
                    <docking:ToolWindow Title="Bottom ToolWindow" />
                </docking:ToolWindowContainer>
            </docking:DockSite.AutoHideBottomContainers>
            <docking:SplitContainer Orientation="Horizontal">
                <docking:SplitContainer Orientation="Vertical">
                    <docking:ToolWindowContainer>
                        <docking:ToolWindow Title="twOne"/>
                    </docking:ToolWindowContainer>
                    <docking:ToolWindowContainer>
                        <docking:ToolWindow Title="twTwo"/>
                        <docking:ToolWindow Title="twThree" />
                    </docking:ToolWindowContainer>
                </docking:SplitContainer>
                <docking:Workspace>
                .
                .
                .

 Any thoughts?

 

Thanks... Rick

[Modified 4 years ago]

Comments (6)

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Rick,

You would need to put the ToolWindowContainer that contains twTwo and twThree into the DockSite.AutoHideLeftContainers collection instead to achieve that.


Actipro Software Support

Posted 4 years ago by Rick - Developer, Visual Software Systems LLC
Avatar

Putting them in the AutoHideLeftContainer means they would nolonger be nested within the ToolWindowContainer that hosts twOne so when you unhide and pin twTwo or twThree the user would see two side-by-side tool windows rather than twOne and twTwo/twThree stacked.

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Rick,

Yes that's true.  What you could do is leave the XAML as you have it, then run your app.  Auto-hide the twTwo/twThree container.  Then serialize your layout to XML and use that as your app's default layout that you ship with, meaning if the user hasn't yet saved a layout when the app runs, restore this default layout from XML.  It should have a breadcrumb in it that tells the tool windows where to restore to when docked again.


Actipro Software Support

Posted 4 years ago by Rick - Developer, Visual Software Systems LLC
Avatar

OK, Thanks.  I can do that, but was hoping there was a way to configure this directly in XAML.  Can you add this as an enhancement request? 

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Rick,

How would you like to see this work?  Do you have any sample XAML ideas you were thinking of?


Actipro Software Support

Posted 4 years ago by Rick - Developer, Visual Software Systems LLC
Avatar

I was thinking a property (State?) on the ToolWindowContainer that could be set via XAML.  Options could be something like Hidden, Visible, Floating, etc.

        <docking:DockSite x:Name="dockSite" >
            <docking:DockSite.AutoHideBottomContainers>
                <docking:ToolWindowContainer >
                    <docking:ToolWindow Title="Bottom ToolWindow" />
                </docking:ToolWindowContainer>
            </docking:DockSite.AutoHideBottomContainers>
            <docking:SplitContainer Orientation="Horizontal">
                <docking:SplitContainer Orientation="Vertical">
                    <docking:ToolWindowContainer>
                        <docking:ToolWindow Title="twOne"/>
                    </docking:ToolWindowContainer>
                    <docking:ToolWindowContainer State="Hidden">
                        <docking:ToolWindow Title="twTwo"/>
                        <docking:ToolWindow Title="twThree" />
                    </docking:ToolWindowContainer>
                </docking:SplitContainer>
                <docking:Workspace>
                .
                .
                .
The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.