public override void OnFrameworkInitializationCompleted() { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { var application = new Base.Application(binder => binder.Bind <MainWindowViewModel>()); application.Start(); var mainViewModel = application.ServiceProvider.Get <MainWindowViewModel>(); desktop.MainWindow = new MainWindow { DataContext = mainViewModel }; } base.OnFrameworkInitializationCompleted(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var application = new Base.Application(binder => binder.Bind <MainViewModel>()); application.Start(); var mainViewModel = application.ServiceProvider.Get <MainViewModel>(); var mainView = new MainView { DataContext = mainViewModel }; mainView.Show(); application.NotifyInitialStates(); }