Closed abrasat closed 7 years ago
I'll look to add that capability for the next release.
For now though, you could register the view-model with the IoC container (perhaps with a string key).
Dependency.Register<MyViewModel>(myViewModel, "TemporaryTask");
Then when you're done, unregister it by calling:
Dependency.Register<MyViewModel>(null, "TemporaryTask");
Thank you for the reply. I will take a look into the proposed workaround, I guess that I have to register the view model before calling the Navigate() method, and deregister it after calling the GoBack() method.
Please see the latest pre-release version 2.0.0-alpha.
You can pass parameters by using the Navigate overload, like so:
navigationService.Navigate(Routes.Page2, "Message from Page1ViewModel");
And then retrieve the value using:
object argumentPassedFromPage1 = navigationService.NavigationArgument;
The signature of the IRoutingService.Register method has changed and now uses Action
The branch for this work is named NavigationParameters.
Is it possible to pass a parameter to the NavigationService ? Or what possibility is available to dynamically inject a view-model to a page reached by a call to the NavigateTo() method ? I need such functionality to open a detail view page, for instance when clicking on a row in a grid view. How can be passed to the detail view page the view model corresponding to the grid-view row that was selected ?