public FetchDataViewModel(HttpClient http) { _http = http; LoadForecasts = ReactiveCommand.CreateFromTask(LoadWeatherForecastsAsync); _forecasts = LoadForecasts.ToProperty(this, x => x.Forecasts, scheduler: RxApp.MainThreadScheduler); }
public FetchDataViewModel(WeatherForecastService weatherForecastService) { _weatherForecastService = weatherForecastService; LoadForecasts = ReactiveCommand.CreateFromTask(LoadWeatherForecastsAsync); _forecasts = LoadForecasts.ToProperty(this, x => x.Forecasts, scheduler: RxApp.MainThreadScheduler); }