protected override void OnStartup(StartupEventArgs e)
        {
            Current.DispatcherUnhandledException += ApplicationUnhandledException;

            base.OnStartup(e);

#if (DEBUG)
            RunInDebugMode(e.Args);
#else
            RunInReleaseMode(e.Args);
#endif
        }

#endregion

        private static void RunInReleaseMode(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += AppDomainUnhandledException;

            try
            {
                SplashScreen screen = new SplashScreen(@"Images\splashscreen.png");
                screen.Show(true, true);

                RunInDebugMode(args);
            }
            catch (Exception ex)
            {
                HandleException(ex);
            }
        }

        private static void RunInDebugMode(string[] args)
        {
            var bootstrapper = new Bootstrapper();
            bootstrapper.Run();
        }
By Anonymous, 2019-07-09 09:44:00