How can I get a DockingWindow by tab order?

Docking/MDI for WPF Forum

Posted 15 years ago by SeongTae Jeong
Version: 9.1.0502
For example,

I would like to write code as next,

DockingWindow window1 = this.dockSite.GetDockingWindow( 0 ); // Window in 1st tab
DockingWindow window2 = this.dockSite.GetDockingWindow( 1 ); // Window in 2nd tab

As you know, currently GetDockingWindow doesn't support integer index parameter.
Also, DockSite.Documents property has docking windows in order by the time of creation.

Is there any appropriate method or property?

Thanks in advance.

Comments (2)

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

Maybe get the current IMdiHost with Workspace.Content as IMdiHost. Then from the MDI host, you'll be able to see a Containers property that you can iterate through. Each IMdiContainer has a Documents array property.

If you loop through all those things and put the windows in a list, it will probably match the order you see the items on screen.

Actipro Software Support

Posted 15 years ago by SeongTae Jeong
Thanks for your reply. :)

As you pointed it out, I could solve my problem as follows,
            TabbedMdiHost mdiHost = this.viewSite.Workspace.Content as TabbedMdiHost;

            TabbedMdiContainer tabbedContainer = mdiHost.Content as TabbedMdiContainer;

            ToolWindow toolWindow = tabbedContainer.Items[index] as ToolWindow;
            toolWindow.IsSelected = true;
TabbedMdiContainer.Items is the workaround.

Thanks again! :)
The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.