public AppBootstrapper()
            : base()
        {
            windowManager = new WindowManager();
            defaultFactory = new DefaultFactory();
            smEntities = new stagemanagerEntities();

            entityService = new EntityService(defaultFactory, smEntities);
            viewController = new ViewController();

            // Observer observable
            MainViewModel mainViewModel = new MainViewModel();
            mainViewModel.SomethingHappened += viewController.HandleEvent;

            // Show Window
            windowManager.ShowWindow(mainViewModel);
        }
Beispiel #2
0
        public void Connect()
        {
            Login myLogin = new Login();
            administrators user = myLogin.Connect(username, password);

            if (user != null)
            {
                // Observer observable
                ViewController viewController = new ViewController();
                MainViewModel mainViewModel = new MainViewModel(user);
                mainViewModel.SomethingHappened += viewController.HandleEvent;
                WindowManager windowManager = new WindowManager();
                mainViewModel.ChangeButton(decideWindowState());
                windowManager.ShowWindow(mainViewModel);
                WVisible = Visibility.Hidden;
            }
            else
            {
                Visible =true;
            }
        }