I have a DockSite that contains multiple TabbedMdiContainers. How do I get the selected DockingWindow for each TabbedMdiContainer?
Currently I am overriding OnActiveWindowChanged, walking the logical tree to get all TabbedMdiContainers and retrieving the SelectedWindow on each TabbedMdiContainer as follows:
var tabbedMdiContainers = DocumentWindows .Select(GetLogicalAncestor<TabbedMdiContainer>) .Where(m => m.HasValue) .Select(m => m.Value) .Distinct() .ToList(); var selectedWindows = tabbedMdiContainers.Select(c => c.SelectedWindow).Where(c => c != null).ToList();
Is there a better way?