Exemple #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var stateManager = new DefaultApplicationStateManger();

            stateManager.GotToNewState(ApplicationState.BOOTSTRAPPING);
            try
            {
                base.OnStartup(e);
                ApplicationBootstrapper bootstrapper = new ApplicationBootstrapper(stateManager);
                bootstrapper.Run();
                this._applicationContent = bootstrapper.ContentContainer;
                stateManager.GotToNewState(ApplicationState.RUNTIME);
                Current.MainWindow = (Window)bootstrapper.CurrentShell;
                Current.MainWindow.Show();
            }
#pragma warning disable 168
            catch (Exception exception)
#pragma warning restore 168
            {
                stateManager.GotToNewState(ApplicationState.FATAL_ERROR);
                /*TODO: do some work here on notifying a user about the failure*/
                throw;
            }
        }