示例#1
0
        /// <summary>
        /// All the bootstrapping will be handled here.
        /// </summary>
        protected override void OnStartup(StartupEventArgs e)
        {
            MainWindow mainWindow = new MainWindow();
            INavigationManager navigationManager = new NavigationManager(mainWindow);
            IFileRepository fileRepository = new FileRepository();
            IUserInteractionManager userInterationManager = new UserInteractionManager(mainWindow);
            var folderSelectorViewModel = new FolderSelectorViewModel(navigationManager, fileRepository);
            var fileListViewModel = new FileListViewModel(navigationManager, fileRepository, userInterationManager);
            var viewModels = new IViewModel[]
            {
                folderSelectorViewModel,
                fileListViewModel
            };

            var mainWindowViewModel = new MainWindowViewModel(viewModels, navigationManager);

            mainWindow.DataContext = mainWindowViewModel;
            mainWindow.Show();
        }
 public void TestInit()
 {
     BaseInit();
     _folderPath = "SomePath";
     _sut = new FileListViewModel(_navigationManagerMock, _fileRepositoryMock, _userInteractionManager);
 }