I am working with a form that contains the following structure:
DockSite
Workspace
TabbedMdiHost
TabbedMdiContainer
set of DocumentWindows
Some of the document windows are created in XAML. Others are created or deleted programmatically. I am having a problem with proper deletion. When I perform the delete operation, all the affected document windows get properly removed from the DockSite DocumentWindows collection. However, one of them does not get removed from the underlying TabbedMdiContainer DocumentWindow collection. There are several unique characteristics concerning the window that does not get removed, but I have been unable to determine which might be affecting the operation. This window has no title and no content (on purpose). Also, at the time that it is removed, it has been tagged (not by me, but somehow behind the scenes) as the primary window. What do I need to do to properly remove the window from the container as well as from the DockSite DocumentWindows collection? (If I need to set another window as the primary one, how do I do this?). Thanks.