DockSite document windows order

Docking/MDI for WPF Forum

Posted 2 days ago by Procam
Version: 25.1.1
Avatar

Hello,

is there a way how to get the order of the document windows within DockSite? I need something like this:
dockSite.DocumentWindows[0].ParentContainer.TabControl.Items

Thanks!

Comments (3)

The latest build of this product (v25.1.2) was released 2 days ago, which was before the next post in this thread.
Posted 1 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

This kind of code would get you all the docking windows in the primary dock host:

if (dockSite.PrimaryDockHost.Workspace?.Content is TabbedMdiHost mdiHost) {
	var windows = mdiHost.GetDocuments();
}

Note tool windows could be in that result too if they are in the MDI area.  You can filter those out if you only look at DocumentWindow classes.

If you also want to look at floating dock hosts, you can use similar logic when iterating the DockSite.FloatingDockHosts collection.


Actipro Software Support

Posted 20 hours ago by Procam
Avatar

Thansk for pointing the floatings one:

Apart of tool windows I have 2 document windows docked (A and B). In the event dockSite_WindowsDragged after dragging one of the document windows (B), somewhere to another monitor, to be floating I cought the following:

dockSite.FloatingDockHosts = 

"DockHost[IsPrimaryDockHost=False; Child=ToolWindowContainer[SelectedWindow=(none)]]"
"DockHost[IsPrimaryDockHost=False; Child=ToolWindowContainer[SelectedWindow=(none)]]"
"DockHost[IsPrimaryDockHost=False; Child=ActiproSoftware.Windows.Controls.Docking.Workspace]" <=== A ?
"DockHost[IsPrimaryDockHost=False; Child=ActiproSoftware.Windows.Controls.Docking.Workspace]" <=== B ?

As I see there seems to be 2 document windows (A and B) instead of the only one floating (B). Is there something wrong?

Answer - Posted 8 hours ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

That is expected and by design.  When you dock a floating document window back into the main dock site again, we retain the floating dock host as a "breadcrumb" so that if the same document window is floated again, it will return to the exact bounds it was at before.  If you close and destroy the document window, that breadcrumb floating dock host will be removed.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.