Conducting floating windows

Topics: Getting Started, UI Architecture
Feb 21, 2012 at 11:46 AM

Hi. My WPF app is composed of multiple floating windows and my main window needs to be contextually aware of the active window (i.e. it is the parent of all other floating windows). A child window might become active because a user clicked it's title bar, or because it was selected from a context menu in the main window, in which case it needs to be made the foreground window.

HelloScreens shows conducting views hosted within a parent view, and HelloWindowManager shows proper use of the WindowManager. What is the "proper" way to combine the two?



Feb 21, 2012 at 7:42 PM

You probably need to create a custom window manager for your scenario. You could use the source for the built in WindowManager as a starting point and just add the functionality you need from there.

Feb 23, 2012 at 3:11 PM

Thanks. Yes, that looks like the best place for the code. My initial approach was to handle ViewAttached, but this polluted my VM with window-specific code.

For starters I just want to extend the WindowConductor to ensure the host window and the IActivate/IDeactivate implementation are synchronised. However, I cannot do this without reimplementing CreateWindow, which I was hoping to avoid. 

I'll post here if I come up with anything useful to others.