WindowStartupLocation="CenterOwner" when Owner is null
<p>How exactly the <code>WindowStartupLocation="CenterOwner"</code> works if the Owner window is null? Is it possible to change somehow this behaviour (preferably globally in an application and not on each window) ?</p>

<p>In my application I have several dialogs (most of them help to change some of the application's configuration / settings), which I either show before defining the <code>Application.Current.MainWindow</code> or after. For example, on application startup I display a windows where someone can select the application language. I display the exact same through application setting pane / window.</p>

<p>I want this language selection window to be appeared </p>

<ul>
<li>on the center of the screen when is called on application startup, thus <code>Application.Current.MainWindow</code> is null and selection window has no owner</li>
<li>on the center of its parent / owner windows when it is called from application setting pane / window</li>
</ul>

<p>The <code>WindowStartupLocation</code> is the property that defines the location of the window. However if I set <code>WindowStartupLocation="CenterOwner"</code> and the owner is null the window will be displayed at the left upper corner of my screen.</p>

<p>Until now I have an if statement in 'every' window constructor that check if owner is null and changes the <code>WindowStartupLocation</code>. </p>

<pre><code>if (dialog.Owner == null &amp;&amp; dialog.WindowStartupLocation == WindowStartupLocation.CenterOwner)
{
    dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
}
</code></pre>

<p>Is there a more elegant way to do it? For example instruct framework to handle it. Set something like fallback values for WindowStartupLocation, e.g if the owner is null then <code>WindowStartupLocation="CenterScreen"</code></p>