When navigating throughout your Prism for Xamarin.Forms applications, it is often required to pass parameters from one View to another. Prism allows you to pass navigation parameters with three simple steps:
1. Create the navigation parameters
2. Get the navigation parameters
3. Read the navigation parameter values
Passing parameters to the next View/ViewModel can be done using an overload of the INavigationService.NavigateAsync method. This overload accepts a NavigationParameters object that can be used to supply data to the next View. The NavigationParameters object can accept any arbitrary object as a value.
Getting the navigation parameters from the target View/ViewModel is done by implementing the INavigationAware interface. The OnNavigatedFrom, OnNavigatingTo, and OnNavigatedTo methods each represent the different phases of the navigation process and expose the INavigationParameters object to you.
You read the INavigationParameters values by using either the index of the collection, the GetValue/GetValues method, or by using the TryGetValue method.
Visit our Sponsor: https://bit.ly/prism-infragistics