Exemplo n.º 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var db = MyDbContext.Create();
            var _destinationPath = AppDomain.CurrentDomain.BaseDirectory + "Images\\";

            _destinationPath = _destinationPath.Replace("\\", "/");
            _destinationPath = _destinationPath.Replace("/bin/Debug", "");
            var imagePath = db.Products.Select(x => x.ImagePath).FirstOrDefault();

            if (!_destinationPath.Contains(imagePath))
            {
                foreach (var overwritePath in db.Products)
                {
                    overwritePath.ImagePath = _destinationPath + Path.GetFileName(overwritePath.ImagePath);
                }

                db.SaveChanges();
            }


            base.OnStartup(e);
            ApplicationView      app     = new ApplicationView();
            ApplicationViewModel context = ApplicationViewModel.Instance;

            app.DataContext = context;
            app.Show();
        }
Exemplo n.º 2
0
        private void App_OnStartup(object sender, StartupEventArgs e)
        {
            DispatcherHelper.Initialize();

            var applicationWindow = new ApplicationView();

            applicationWindow.Show();
        }
Exemplo n.º 3
0
        private void App_OnStartup(object sender, StartupEventArgs e)
        {
            DispatcherHelper.Initialize();

            var applicationWindow = new ApplicationView();

            applicationWindow.Show();
        }
Exemplo n.º 4
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     var app = new ApplicationView();
     var context = new ApplicationViewModel();
     app.DataContext = context;
     app.Show();
 }
Exemplo n.º 5
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ApplicationView app = new ApplicationView();

            app.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            app.Show();
        }
Exemplo n.º 6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ApplicationView      app     = new ApplicationView();
            ApplicationViewModel context = new ApplicationViewModel();

            app.DataContext = context;
            app.Show();
        }
Exemplo n.º 7
0
        private void App_OnStartup(object sender, StartupEventArgs e)
        {
            this._viewModel = new ApplicationViewModel(new SyllablesService(), new TranscriptionService(),
                                                       new PlaybackService(new AsyncBackgroundWorker()));

            ApplicationView view = new ApplicationView {
                DataContext = this._viewModel
            };

            view.Show();
        }
Exemplo n.º 8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            EventManager.RegisterClassHandler(typeof(TextBox),
                                              TextBox.KeyUpEvent,
                                              new System.Windows.Input.KeyEventHandler(TextBox_KeyUp));

            base.OnStartup(e);

            ApplicationView      app     = new ApplicationView();
            ApplicationViewModel context = new ApplicationViewModel();

            app.DataContext = context;
            app.Show();
        }
Exemplo n.º 9
0
 private void OnLoggedInMessageReceived(string username)
 {
     if (username == "un_authorized_user")
     {
         login = new LoginView();
         var loginVM = new LoginViewModel(authoService);
         login.DataContext = loginVM;
         login.Show();
         app.Close();
     }
     else
     {
         app = new ApplicationView();
         var appVM = new ApplicationViewModel();
         app.DataContext = appVM;
         app.Show();
         login.Close();
     }
 }