
I want to know when all my documents are floating. I.e. no documents in the main docksite. In OnFloatingWindowOpening if I check the Documents IsFloating property it is false. What is the suggested way to determine this state?
I want to know when all my documents are floating. I.e. no documents in the main docksite. In OnFloatingWindowOpening if I check the Documents IsFloating property it is false. What is the suggested way to determine this state?
Hi Kyle,
The DockingWindow.IsFloating property checks to see if the containing DockHost is floating (not the primary DockHost within the DockSite) and returns a boolean indicating that state.
If I add this code to our main Docking/MDI demo and then call it in response to a menu item, it seems to return true when all open documents are floating (or there are no open documents).
MessageBox.Show(dockSite.Documents.All(d => d.IsFloating).ToString());
Thanks for your reply. The use case I'm trying to deal with is when the primary dockhost has a document, and the user floats that document. I want to be able to determine if the primary dockhost has any remaining documents. I can use OnFloatingWindowOpening but at that point in time the IsFloating returns false.
Hi Kyle,
Since it's still opening a DockHost into a floating window at that point, it probably hasn't registered the change yet. Perhaps you could Dispatcher.BeginInvoke the call to your logic from that method using Loaded dispatcher priority? That would likely give it enough time to finalize the layout change.
That worked, I don't suppose there is a way to tell when a floating window is moved back to the main document group?
Hi Kyle,
The DockSite.WindowsDockHostChanged event fires when the DockHost changes. So that would fire when a document is floated or restored to the primary DockHost.
Please log in to a validated account to post comments.