How can I get a DockingWindow by tab order?

Docking/MDI for WPF Forum

Posted 10 years ago by SeongTae Jeong
Version: 9.1.0502
Avatar
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 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
SeongTae,

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 10 years ago by SeongTae Jeong
Avatar
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 (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.