예제 #1
0
파일: App.xaml.cs 프로젝트: krabd/FindMusic
        protected override void OnStartup(StartupEventArgs e)
        {
            var startupService = new StartupService();
            var services       = startupService.Configure();
            var configuration  = startupService.ConfigureSettings();

            services.AddDbContext <FindMusicContext>((serviceProvider, options) =>
            {
                var connectionString = configuration.GetConnectionString("Storage");
                options.UseSqlite(connectionString);
            });

            var provider = startupService.BuildProvider(services);

            var findMusic = provider.Resolve <FindMusicViewModel>();
            var window    = new MainWindow {
                DataContext = findMusic
            };

            Current.MainWindow = window;
            window.Show();

            base.OnStartup(e);
        }