예제 #1
0
파일: App.xaml.cs 프로젝트: holydk/Farming
        protected override void OnStartup(StartupEventArgs e)
        {
            var cnnService = new FarmingConnectionService();
            var authSnackbarMessageQueue = new SnackbarMessageQueue();
            var cnnViewModel             = new SignInViewModel(cnnService, authSnackbarMessageQueue);
            var authView = new AuthorizationView(cnnViewModel, authSnackbarMessageQueue);

            ConnectionEventHandler onSuccessfulSignIn = null;

            onSuccessfulSignIn = (obj, _e) =>
            {
                cnnService.SuccessfulSignIn -= onSuccessfulSignIn;

                var navigation           = new Navigation();
                var snackbarMessageQueue = new SnackbarMessageQueue();
                var mainViewModel        = new MainViewModel(_e.User, navigation, "FARMING inc.", snackbarMessageQueue);

                MainWindow = new MainWindow(mainViewModel, snackbarMessageQueue);
                authView.Close();
                MainWindow.Show();
            };

            cnnService.SuccessfulSignIn += onSuccessfulSignIn;

            authView.Show();

            base.OnStartup(e);
        }
예제 #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            if (!Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "/Images"))
            {
                Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + "/Images");
            }

            Data       = new DataBaseSaource();
            AuthWindow = new AuthorizationView();
            AuthWindow.Show();
        }
예제 #3
0
        protected override void OnStartup(StartupEventArgs info)
        {
            base.OnStartup(info);

            var authorizationViewModel = new AuthorizationViewModel(
                StandartNinjectKernel.Get <IUserRelatedRepository>(),
                StandartNinjectKernel.Get <IUserSession>()
                );

            var authorizationView = new AuthorizationView()
            {
                DataContext = authorizationViewModel
            };

            authorizationViewModel.RelatedView = authorizationView;

            authorizationView.Show();
        }