public IdentifyViewModel(IFaceServiceClient client, IDialogService dialogService) { this.client = client; var fileSelector = new ObservableFileSelector(); var imageSelector = new ImageSelector(fileSelector.SelectFilesCommand); detector = new Detector(client); SelectFilesCommand = fileSelector.SelectFilesCommand; var filesObs = SelectFilesCommand.Publish(); IdentifyCommand = ReactiveCommand.CreateFromTask(IdentifyFaces, imageSelector.Images.Any()); imagesObs = imageSelector.Images .Select(list => list.Select(data => new IdentificationViewModel(data.Image, data.Source)).ToList()) .ToProperty(this, model => model.Identifications); IdentifyCommand.Subscribe(SetIdentifications); IdentifyCommand.ThrownExceptions.Subscribe(async exception => await dialogService.ShowException(exception)); isBusyObs = IdentifyCommand.IsExecuting.ToProperty(this, model => model.IsBusy); filesObs.Connect(); }