I had this problem, but since the window was opening from the view model, I did not have a link to the current window. To get around this, I used this code:
var myWindow = new MyWindowType(); myWindow.Owner = Application.Current.Windows.OfType<Window>().SingleOrDefault(x => x.IsActive);
You can use: myWindow.Owner = Application.Current.MainWindow;
However, this method causes problems if you have three windows open:
MainWindow | -----> ChildWindow1 | -----> ChildWindow2
Then set ChildWindow2.Owner = Application.Current.MainWindow to establish that the owner of the window is its grandfather window, not the parent window.
source share