I have WPF application where I have changed the default entry point.
<Application x:Class="FrazerClient.App" Startup="AppStartup">
public void AppStartup(object sender, StartupEventArgs e)
{
// Does some minor work before an application window opens.
}
The minor work calls this a couple of times:
App.Current.Dispatcher.Invoke((Action)delegate
{
// Custom dialog window is opened
});
The second time this is called, App.Current becomes null. I am almost positive is has to do with the custom dialog window closing, but not really sure how to prevent the closing of the dialog window from nulling out App.Current
when the last window closes.
This also prevents App.Current.Shutdown()
from working.