Example #1
0
 protected override void InitializeShell()
 {
     base.InitializeShell();
     AppDomain.CurrentDomain.UnhandledException        += CurrentDomain_UnhandledException;
     Application.Current.Dispatcher.UnhandledException += Dispatcher_UnhandledException;
     Application.Current.MainWindow = (Window)Shell;
     ShowMainWindow();
     SplashScreenHelper.CloseSplash();
 }
Example #2
0
        /// <summary>
        /// Erzeugt eine neue Shell
        /// </summary>
        /// <returns></returns>
        protected override DependencyObject CreateShell()
        {
            try
            {
                Task <LoadClientResult> contextTask = Task.Run(async() => { return(await LoadClientContext()); });
                contextTask.Wait();
                var result = contextTask.Result;
            }
            catch (AggregateException exception)
            {
                SplashScreenHelper.CloseSplash();
                MessageBox.Show(exception.InnerException.Message);
                return(null);
            }

            ViewModelLocationProvider.SetDefaultViewModelFactory(t =>
            {
                return(Container.Resolve(t));
            });
            MainWindow view = Container.TryResolve <MainWindow>();

            return(view);
        }