protected override void OnStartup(StartupEventArgs e) { IoCKernel.Initialize( new StandardModule(DbContextString), new BusinessModule()); string folderName = ConfigurationManager.AppSettings["applicationDataDirectoryName"]; if (folderName == null) { throw new ConfigurationErrorsException("Missing appsetting applicationDataDirectoryName"); } var completePath = System.IO.Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), folderName); if (Directory.Exists(completePath) == false) { Directory.CreateDirectory(completePath); } AppDomain.CurrentDomain.SetData("DataDirectory", completePath); base.OnStartup(e); }
public ExplorerWindow() { InitializeComponent(); var types = ApplicationConfig.MediaTypes; var mediatypes = new MediaTypes(types); DataContext = Model = IoCKernel.Get <IExplorerViewModel>(new ConstructorArgument("mediaTypes", mediatypes, true)); }
public MainWindow() { InitializeComponent(); DataContext = Model = IoCKernel.Get <ILibraryViewModel>(); }