Force the application to shut down.
Application.Current.Dispatcher.Invoke(Application.Current.Shutdown);