How to set a dialog position to show at the center of the application?

In the XAML belonging to the Dialog:

<Window ... WindowStartupLocation="CenterOwner">

and in C# when you instantiate the Dialog:

MyDlg dlg = new MyDlg();
dlg.Owner = this;

if (dlg.ShowDialog() == true)
{
    ...

Leave a Comment