Esempio n. 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            IAppViewModelFactory viewModelFactory = this.ConfigureContainer();
            ILoginViewModel      loginViewModel   = viewModelFactory.ResolveViewModel <ILoginViewModel>();

            loginViewModel.ShowDialog();
            if (loginViewModel.DialogResult != null)
            {
                IMainViewModel mainViewModel = viewModelFactory.ResolveViewModel <IMainViewModel>();

                mainViewModel.Closed += (s, ea) => this.Shutdown();
                mainViewModel.Show();
            }
            else
            {
                this.Shutdown();
            }
        }
Esempio n. 2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            this.ShutdownMode = ShutdownMode.OnExplicitShutdown;

            IAppViewModelFactory viewModelFactory = CreateAndConfigureFactory();

            IMainViewModel mainViewModel = viewModelFactory.ResolveViewModel <IMainViewModel>();

            mainViewModel.Closed += (s, ea) => this.Shutdown();
            mainViewModel.Show();
        }