public ScaffoldingWizardViewModel( IMessageBoxService messageBoxService, IDatabaseService dbService, IDatabaseConnector dbConnector, IScaffoldingService scaffoldingService, IReadOnlyCollection <Project> allSolutionProjects) { _messageBoxService = messageBoxService; _dbService = dbService; _dbConnector = dbConnector; _scaffoldingService = scaffoldingService; DatabaseConnectionVM = new DatabaseConnectionViewModel(messageBoxService, dbConnector); DatabaseConnectionVM.PropertyChanged += onValidationStateChanged; TablesVM = new TablesViewModel(_messageBoxService); TablesVM.PropertyChanged += onValidationStateChanged; OutputParamsVM = new OutputParamsViewModel(allSolutionProjects); OutputParamsVM.PropertyChanged += onValidationStateChanged; State = new WizardState( () => IsLoading, () => CurrentStepNumber, () => DatabaseConnectionVM.IsValid, () => TablesVM.IsValid, () => OutputParamsVM.IsValid ); BackCommand = new Command(goBack); NextCommand = new AsyncCommand(goNext); OkCommand = new AsyncCommand(okExecute); }
public CommandAvailabilityService(IVisualStudioAccess visualStudioAccess, IScaffoldingService scaffoldingService, IScriptCreationService scriptCreationService) { _visualStudioAccess = visualStudioAccess ?? throw new ArgumentNullException(nameof(visualStudioAccess)); _scaffoldingService = scaffoldingService ?? throw new ArgumentNullException(nameof(scaffoldingService)); _scriptCreationService = scriptCreationService ?? throw new ArgumentNullException(nameof(scriptCreationService)); }