I\'ve WPF application which has one Main window on which I\'m opening a Popup window. The problem I\'m facing is the Popup window always stays on top. If I open some other a
Popups
do - as far as i know - not suppot such a behavior, their intended usage is for ComboxBox
-dropdowns and the like as far as i can tell. To realize something like that you can use a normal Window
and set its Owner to the main window on which it should be dependent. This will cause the popup-window to stay on top of its owner & to minimize together with the owner.
e.g.
public class ChildWindow: Window
{
public ChildWindow(Window owner)
{
this.Owner = owner;
}
}
var popup = new ChildWindow(mainWindow);
popup.Show();
(Windows cannot be re-opened once closed, so to reuse a window you just have to Hide()
it when the user tries to close it (handle Closing
event and cancel using event args))