Setting the startupUri
is always better than recreating window
all over again.
Also there are other options for opening window based on some conditions like having age old console Main method
for opening window. Few more options can be found here.
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
if (!Settings.Instance.firstStart)
{
MainWindow mainWindow = new MainWindow();
mainWindow.Show();
}
else
{
WindowLanguage windowLanguage = new WindowLanguage();
windowLanguage.Show();
}
}