I can't get my MainWindow to show without using StartupUri. OnStartup doesn't trigger.
I removed StartupUri from App.xaml
<Application x:Class="SCon"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</Application>
added the following in the code behind
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
SCon.MainWindow.Instance.Show();
}
MainWindow is a singleton
private static volatile MainWindow instance = null;
private static object lockThis = new object();
public static MainWindow Instance
{
get
{
if (instance == null)
{
lock (lockThis)
{
if (instance == null)
{
instance = new MainWindow();
}
}
}
return instance;
}
}