public ShellViewModel(Services.Settings settings, IDialogManager dialogManager) { _settings = settings; _projectRepository = new ProjectRepositoryViewModel(settings); _dialogManager = dialogManager; DisplayName = "Solutionizer"; }
public ViewModelFactory( Func<SettingsViewModel> getSettingsViewModel, Func<AboutViewModel> getAboutViewModel, UpdateViewModel.Factory getUpdateViewModel, ProjectRepositoryViewModel.Factory getProjectRepositoryViewModel, FileScanningViewModel.Factory getFileScanningViewModel, SolutionViewModel.Factory getSolutionViewModel) { _getSettingsViewModel = getSettingsViewModel; _getAboutViewModel = getAboutViewModel; _getUpdateViewModel = getUpdateViewModel; _getProjectRepositoryViewModel = getProjectRepositoryViewModel; _getFileScanningViewModel = getFileScanningViewModel; _getSolutionViewModel = getSolutionViewModel; }
public ShellViewModel(ISettings settings, IDialogManager dialogManager, IFlyoutManager flyoutManager, IUpdateManager updateManager, IViewModelFactory viewModelFactory, IMostRecentUsedFoldersRepository mostRecentUsedFoldersRepository) { _settings = settings; _dialogManager = dialogManager; _flyoutManager = flyoutManager; _updateManager = updateManager; _viewModelFactory = viewModelFactory; _mostRecentUsedFoldersRepository = mostRecentUsedFoldersRepository; _projectRepository = _viewModelFactory.CreateProjectRepositoryViewModel(new RelayCommand<ProjectViewModel>(projectViewModel => _solution.AddProject(projectViewModel.Project))); _updateManager.UpdatesAvailable += (sender, args) => AreUpdatesAvailable = _updateManager.Releases != null && _updateManager.Releases.Any(r => r.IsNew && (_settings.IncludePrereleaseUpdates || !r.IsPrerelease)); _showUpdatesCommand = new RelayCommand<bool>(checkForUpdates => _flyoutManager.ShowFlyout(_viewModelFactory.CreateUpdateViewModel(checkForUpdates))); _showSettingsCommand = new RelayCommand(OnShowSettings); _showAboutCommand = new RelayCommand(() => _flyoutManager.ShowFlyout(_viewModelFactory.CreateAboutViewModel())); _selectRootPathCommand = new AsyncRelayCommand(SelectRootPath); _setRootPathCommand = new AsyncRelayCommand<string>(LoadProjectsAsync, path => !String.Equals(path, RootPath)); _updateTimer = new Timer(_ => _updateManager.CheckForUpdatesAsync(), null, -1, -1); }
public ShellViewModel(ISettings settings, IDialogManager dialogManager, IFlyoutManager flyoutManager, IUpdateManager updateManager, IViewModelFactory viewModelFactory, IMostRecentUsedFoldersRepository mostRecentUsedFoldersRepository) { _settings = settings; _dialogManager = dialogManager; _flyoutManager = flyoutManager; _updateManager = updateManager; _viewModelFactory = viewModelFactory; _mostRecentUsedFoldersRepository = mostRecentUsedFoldersRepository; _projectRepository = _viewModelFactory.CreateProjectRepositoryViewModel(new RelayCommand <ProjectViewModel>(projectViewModel => _solution.AddProject(projectViewModel.Project))); _updateManager.UpdatesAvailable += (sender, args) => AreUpdatesAvailable = _updateManager.Releases != null && _updateManager.Releases.Any(r => r.IsNew && (_settings.IncludePrereleaseUpdates || !r.IsPrerelease)); ShowUpdatesCommand = new RelayCommand <bool>(checkForUpdates => _flyoutManager.ShowFlyout(_viewModelFactory.CreateUpdateViewModel(checkForUpdates))); ShowSettingsCommand = new RelayCommand(OnShowSettings); ShowAboutCommand = new RelayCommand(() => _flyoutManager.ShowFlyout(_viewModelFactory.CreateAboutViewModel())); SelectRootPathCommand = new AsyncRelayCommand(SelectRootPath); SetRootPathCommand = new AsyncRelayCommand <string>(LoadProjectsAsync, path => !String.Equals(path, RootPath)); _updateTimer = new Timer(_ => _updateManager.CheckForUpdatesAsync(), null, -1, -1); }