Ejemplo n.º 1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            container = new UnityContainer();
            TaskManagerDbContext.Initialize();
            RegisterTypes(container);
            var vm      = container.Resolve <IMainWindowViewModel>();
            var win     = new MainWindow(vm);
            var context = container.Resolve <TaskManagerDbContext>();

            var jobs = new List <IJobViewModel>();

            foreach (var job in context.Jobs)
            {
                jobs.Add(container.Resolve <IJobViewModel>(
                             new ParameterOverride("contentManager", vm),
                             new ParameterOverride("job", job)));
            }

            vm.Content = container.Resolve <IJobListViewModel>(new ParameterOverride("contentManager", vm), new ParameterOverride("jobs", jobs));

            win.Show();
        }