Linked Nested Docksites

Docking/MDI for WPF Forum

Posted 6 years ago by JJ
Version: 13.1.0581
Avatar

I'm trying to implement linked/nested docksites with serialization.  So if I have ParentDockSite with two children ChildDocksite1 and ChildDocksite2, I want the children to be able to serialize their individual layouts.  Also, the parent should be able to serialize it's layout, with the layout of the children also saved.  In addition, all the docksites should be linked so that I can move content and views between the docksites.  I have the child docksites contained within a rafting host/tool window.

I have got the nesting and linking working, but my issue is with dragging content into child docksites.  It seems to sometimes give me the docking options of the rafting host or tool window.  Other times I will get the docking options of the child docksite underneath.  For these windows, I would prefer to see the docking options of the child docksites so that the content can be moved into the child docksite.  Is there a way to force this?

Also, do you have opinion on this approach?  The idea is to be able to save overall layout of the parent docksite, but also have customizable child docksites that can be saved and reloaded within the main docksite, without destroying the current layout of the parent docksite.  Do you foresee any issues when it comes time for me to then implement the nested serialization?

[Modified 6 years ago]

Comments (5)

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

Hi JJ,

If you see some issues with how the options are applied, perhaps you could provide us with a simple sample project showing it so we have something to debug with.  You can send it to our support address, mention this post, and rename the .zip file extension so it doesn't get spam blocked.

As for layouts, each layout is specific only to a particular DockSite.  So you'd need to serialize each of the three DockSite layouts separately.  Then when you later restore, restore the parent one first, then the two child ones.  That way the tool window in the parent that will host the two child DockSites will have the proper size when those layouts are restored.  Since you are doing linked DockSites, also read through the lazy loading info in the Layout Serialization topic as that will be important.


Actipro Software Support

Posted 6 years ago by JJ
Avatar

Thanks for your response.  I will consider those things when it comes to serialization.

With regards to the docking "options", what I really meant was the docking guides.  When I drag a view over a toolwindow that contains the docksite, the docking guides that come up can either be the docking guide relative to the toolwindow itself, or the docksite within it.  Is there any way I can control this?  When I drag a view over a toolwindow, I want the docking guide to be that of the docksite, not the toolwindow.

Below is a simplfied example based on your nested docksites documentation.  If have also linked all three docksites in code using docksite.LinkDockSite().

 

            <Docking:DockSite  x:Name="ParentDocksite" reg:RegionManager.RegionName="TestRegion">
                <Docking:SplitContainer>
                    <Docking:ToolWindowContainer>
                        <Docking:ToolWindow Title="ToolWindowWorkspaceView">
                            <MyView1></MyView1>
                        </Docking:ToolWindow>
                    </Docking:ToolWindowContainer>
                    <Docking:ToolWindowContainer>
                        <Docking:ToolWindow Title="ToolWindowChildDocksite1" >
                            <Controls:PrismDockSite x:Name="ChildDocksite1">
                                <Docking:ToolWindowContainer>
                                    <Docking:ToolWindow Title="Inner DockSite 1-1">
                                        <TextBox BorderThickness="0" />
                                    </Docking:ToolWindow>
                                    <Docking:ToolWindow Title="Inner DockSite 1-2">
                                        <MyView2 />
                                    </Docking:ToolWindow>
                                </Docking:ToolWindowContainer>
                            </Controls:PrismDockSite>
                        </Docking:ToolWindow>
                    </Docking:ToolWindowContainer>
                    <Docking:ToolWindowContainer>
                        <Docking:ToolWindow Title="ToolWindowChildDocksite2">
                            <Controls:PrismDockSite x:Name="ChildDocksite2" Dock>
                                <Docking:ToolWindowContainer>
                                    <Docking:ToolWindow Title="Inner DockSite 2-1">
                                        <TextBox BorderThickness="0" />
                                    </Docking:ToolWindow>
                                    <Docking:ToolWindow Title="Inner DockSite 2-2">
                                        <TextBox BorderThickness="0" />
                                    </Docking:ToolWindow>
                                </Docking:ToolWindowContainer>
                            </Controls:PrismDockSite>
                        </Docking:ToolWindow>
                    </Docking:ToolWindowContainer>
                    <Docking:ToolWindowContainer>
                        <Docking:ToolWindow Title="Outer DockSite 1">
                            <TextBox BorderThickness="0" />
                        </Docking:ToolWindow>
                        <Docking:ToolWindow Title="Outer DockSite 2">
                            <TextBox BorderThickness="0" />
                        </Docking:ToolWindow>
                    </Docking:ToolWindowContainer>
                </Docking:SplitContainer>
            </Docking:DockSite>

 

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

Hi JJ,

No unfortunately there isn't any way for you to control which dock guides show up.  It will choose based on what your mouse is over at the time.


Actipro Software Support

Posted 6 years ago by JJ
Avatar

Thanks for your reply.

Half the time, I will only get dock guides appear for the toolwindow and not the docksite, i.e., I can't actually dock into the docksite itself.  

For example, if I dragged Inner Docksite 2-1 over into ToolWindowChildDocksite1, sometimes I will get dock guides for both ToolWindowChildDocksite1 and also ChildDocksite1.  Sometimes, I only get the dock guides for ToolWindowChildDocksite1.  

I can't seem to figure out why this is so.  This happens mostly when say ToolWindowChildDocksite1 is in a floating state; but not always limited to it, because sometimes I can.  Conversely, most of the time, I can dock into ChildDocksite1 when ToolWindowChildDocksite1 is docked inside ParentDocksite, but sometimes I can't.  Is there a reason or behaviour for this that I'm not seeing?

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

Hi JJ,

It's hard to say without seeing this in action. If you can please put together a complete sample project and email it over to our support address, then we can take a closer look.  Please reference this post and rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

The latest build of this product (v2018.1 build 0675) 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.