How to prevent parent window from going into background after child is closed?

set the Main window to:

Topmost=true

This should help a little, but will not solve the issue entirely. Just keep in mind that if another application has the setting, they could end up on top of the application anyways. Let me know if this helps.


I would just have left a comment under the question, but I don't have enough reputation. I encountered this very same issue, and after playing a little bit with the solution presented here, realized that a cleaner solution would be to call Focus() on the parent instead of making it topmost, set a timer, then remove topmost:

ChildWindow.Closed += delegate
{
    ChildWindow = null;
    parentWindow?.Focus();
};