private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
ILoggerService logService = LifetimeService.Instance.Container.Resolve<ILoggerService>();
logService.WriteToLogLevel("XAML Application Dispatcher Unhandled Exception Occured :", LogLevelEnum.Fatal, e.Exception);
MessageBox.Show("XAML Application Dispatcher:" + e.Exception.ToString());
e.Handled = true;/// if you false this and comment following line, then, exception goes to Unhandeled
GracefulExit();
Environment.Exit(0);//We can remove this and can try to recover APP and keep it running.
}