Window.Activate

Jan 18, 2011 at 7:34 PM

Hi,

I used IWindowManager.ShowWindow to open new Window for some ViewModel. User can switch to other window, which could hide the first one.

I want to bring that window back to foreground after some other user action. How I can do that?

I don't have access to Window instance, so I can't call Window.Activate. Maybe I could use IViewAware, but view could be only UserControl not the Window (as Window is created by WindowManager to wrap view).

Thanks,

Petr

Coordinator
Jan 18, 2011 at 8:06 PM

If the window manager creates the window, the window will be the view. You can grab the window via IViewAware and activate it when the VM is activated. It might be better to inherit from WindowManager and add your additional behavior though.