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(); }
private void App_OnStartup(object sender, StartupEventArgs e) { DispatcherHelper.Initialize(); var applicationWindow = new ApplicationView(); applicationWindow.Show(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var app = new ApplicationView(); var context = new ApplicationViewModel(); app.DataContext = context; app.Show(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); ApplicationView app = new ApplicationView(); app.WindowStartupLocation = WindowStartupLocation.CenterScreen; app.Show(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); ApplicationView app = new ApplicationView(); ApplicationViewModel context = new ApplicationViewModel(); app.DataContext = context; app.Show(); }
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(); }
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(); }
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(); } }