How to set Dialog\'s position that came from .ShowDialog(); to show at the center of the mainWindows.
This is the way I try to set position.
You can try to get a hold of the MainWindow in the Loaded event like this
private void Window_Loaded(object sender, RoutedEventArgs e)
{
Application curApp = Application.Current;
Window mainWindow = curApp.MainWindow;
this.Left = mainWindow.Left + (mainWindow.Width - this.ActualWidth) / 2;
this.Top = mainWindow.Top + (mainWindow.Height - this.ActualHeight) / 2;
}