Пример #1
0
        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);
        }
Пример #2
0
        public ExplorerWindow()
        {
            InitializeComponent();

            var types      = ApplicationConfig.MediaTypes;
            var mediatypes = new MediaTypes(types);

            DataContext = Model = IoCKernel.Get <IExplorerViewModel>(new ConstructorArgument("mediaTypes", mediatypes, true));
        }
Пример #3
0
        public MainWindow()
        {
            InitializeComponent();

            DataContext = Model = IoCKernel.Get <ILibraryViewModel>();
        }