public MainViewModel(Func <Task <IFlightAcademyClient> > flightAcademyClientFactory, ContentMatcher mediaMatcher, SettingsViewModel settings) { this.mediaMatcher = mediaMatcher; LoadFlights = ReactiveCommand.CreateFromTask(() => LoadFlightsAsync(flightAcademyClientFactory, mediaMatcher)); flights = LoadFlights.ToProperty(this, x => x.Flights); isBusy = LoadFlights.IsExecuting.ToProperty(this, x => x.IsBusy); Settings = settings; }
public FlightGalleryViewModel(Func <Task <IFlightAcademyClient> > flightAcademyClientFactory, IViewModelFactory viewModelFactory, IDialogService dialogService) { this.viewModelFactory = viewModelFactory; this.dialogService = dialogService; LoadFlights = ReactiveCommand.CreateFromTask(() => LoadFlightsAsync(flightAcademyClientFactory)); var thrownExceptions = LoadFlights.ThrownExceptions.SelectMany(Handle); thrownExceptions.Subscribe().DisposeWith(disposables); flights = LoadFlights.ToProperty(this, x => x.Flights); isBusy = LoadFlights.IsExecuting.ToProperty(this, x => x.IsBusy); }