-
-
Couldn't load subscription status.
- Fork 25
Description
I want to have a reusable viewmodel that can emit results back to the calling viewmodel.
If we can get something like a NavigateForResult with a generic type then that would be neat. Interactions are great but I believe they are best for very simple dialogs and simple results. What about a complex object? What if it's prompted as a popup, but as a full page? Yes we can subscribe to events from the ViewModel before passing it through to Navigate.Execute() but that just returns a IRoutableViewModel object and will make the pipeline less neat :D
ChooseContacts = ReactiveCommand.CreateFromObservable(() =>
HostScreen.Router.NavigateForResult.Execute(new ContactsResultViewModel())
.Select(contacts => /* transform result */));We can do it by making a generic IRoutableViewModel<TResult> so the routing commands can listen to it's result.