This solution worked great for me.
Here's an Ive method for centering a window to either its parent or main application window in WPF. This is not too different from how you do it in WinForms.
For the child window, set its WindowStartupLocation to "CenterOwner". This will cause it to appear in the center of the Ownership window. Collapse
<Window x:Class="WpfApplication1.TestChild" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="TestChild" Height="300" Width="300" WindowStartupLocation="CenterOwner">
Now all that remains to be done is to set its owner before displaying it. If the code used to display the window is running inside the Window class, you can simply use it. Collapse
TestChild testWindow = new TestChild(); testWindow.Owner = this; testWindow.Show();
However, this is not always the case; sometimes you need to display a child window from code running on a page or user control. In this case, you want the child window to be concentrated in the main application window. Collapse
TestChild testWindow = new TestChild(); testWindow.Owner = Application.Current.MainWindow; testWindow.Show();
source share