public WeatherViewModel(WeatherQueryResponse weatherData, IViewFacade viewFacade, WeatherCodeService weatherCodeService, WeatherRecommendationService evaluationService) { WeatherData = weatherData; ViewFacade = viewFacade; WeatherCodeService = weatherCodeService; RecommendationService = evaluationService; }
/// <summary> /// Creates an instance of the <see cref="MainViewModel"/> /// </summary> public MainViewModel(IViewFacade viewFacade, WeatherStackService weatherService, Func <WeatherQueryResponse, WeatherViewModel> weatherViewModelFactory, Func <string, ErrorViewModel> errorViewModelFactory) { ViewFacade = viewFacade; this.WeatherService = weatherService; this.WeatherViewModelFactory = weatherViewModelFactory; ErrorViewModelFactory = errorViewModelFactory; }
public WebAppService(WebAppSettings settings) { var viewStore = new CosmosStore(settings.CosmosEndpoint, settings.CosmosAuthKey, settings.DatabaseId, settings.ViewCollectionId); var stationDetailHandler = new StationDetailHandler(viewStore); var stationListHandler = new StationListHandler(viewStore); var publisher = new LocalPublisher(); publisher.RegisterHandler <StationCreated>(stationDetailHandler.Handle); publisher.RegisterHandler <StationRenamed>(stationListHandler.Handle); var stationRepository = new CosmosEventRepository <Station>(settings.CosmosEndpoint, settings.CosmosAuthKey, settings.DatabaseId, settings.EventCollectionId, publisher); var stationCommandHandlers = new StationHandlers(stationRepository); var bus = new LocalBus(); bus.RegisterHandler <CreateStation>(stationCommandHandlers.Handle); bus.RegisterHandler <RenameStation>(stationCommandHandlers.Handle); Bus = bus; Publisher = publisher; ViewFacade = new ViewFacade(viewStore); }
public FileBrowserViewModel(IViewFacade viewFacade, FileSelectionMode mode, FileInfo?preselectedFile = null) { ViewFacade = viewFacade; this.Mode = mode; this.PreSelectedFile = preselectedFile; }