コード例 #1
0
ファイル: App.axaml.cs プロジェクト: awzhome/taskington
        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();
        }
コード例 #2
0
        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();
        }