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!
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!
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.
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?
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.
Please log in to a validated account to post comments.