Sextant icon indicating copy to clipboard operation
Sextant copied to clipboard

feature: Add NavigateForResult

Open ghost opened this issue 5 years ago • 3 comments

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.

ghost avatar Apr 07 '19 07:04 ghost

Hey @vjlomocso :wave:,

Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider backing us.

https://opencollective.com/reactiveui

PS.: We offer priority support for all backers. Don't forget to add priority label when you start backing us :smile:

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms!

Hey @vjlomocso :wave:,

Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider backing us.

https://opencollective.com/reactiveui

PS.: We offer priority support for all backers. Don't forget to add priority label when you start backing us :smile:

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms!

Sextant is where our navigation is going in the future. Thanks for the suggestion

glennawatson avatar Apr 07 '19 12:04 glennawatson