I have a tabbed MDI host which allows rafting. Outside of the docksite my main window has a file menu. The file menu has such commands as Save, Print, Export, Float, Dock (sorta similar to Visual Studio). I'm trying to make these commands target the window that is currently active by hooking into either DockingWindow.Activated event or the Prism Region IActiveAware changed notification and updating which window is the target of the command. Here's what happens..
- Open two tabbed documents
- raft one of them
- (toggle between them once) click inside the docked window then click back inside the rafted window
- Now when I click the "Window" menu for example the float/dock command doesn't work because it has switched to the DocumentWindow inside the main application.
I put Debug.Writeline messages in the DockingWindow.Activated events and IsActive changed from the Prism region interface. Both of them get called when any interaction occurs on the main window, including carefully clicking the file menu to open it. Visual Studio for example, accurately tracks the currently active window so that file functions can correctly target the current document.
I need to be able to interact with my application's file menu without triggering an ActiveChanged Event for the document window (whichever incarnation of Active I use). How can I get this to work?