I am trying to understand Prism Xamarin navigation and how to relate to xamarin itself
Could somebody correct me where I am wrong?
Xamarin Prism
Navigation.PopAsync = NavigationService.NavigateAsync(uri,
useModalNavigation: true)
= NavigationService.GoBackAsync
Navigation.PushAsync = NavigationService.NavigateAsync(uri,
useModalNavigation: false)
Also in prism
Is NavigationService.NavigateAsync(uri,useModalNavigation: false)
same as
NavigationService.GoBackAsync
Are they both doing the same thing?
OnNavigatingTo(NavigationParameters parameters) vs OnNavigatedTo(NavigationParameters parameters)
They both are fired after the constructor is fired. Any practical example when to use one and when to use another?
What kind of of logic do you place in there.Are they used when you want to load a form?Also generally what kind of validation you put there and why?
public void OnNavigatedTo(NavigationParameters parameters)
{
if(parameters.GetValue<NavigationMode>(KnownNavigationParameters.NavigationMode) == NavigationMode.Back)
{
}
//or logic like
if ( parameters.ContainsKey("myId") )
{
}
}
Why would I use parameters.ContainsKey("myId") or the navigationMode check.
I am just trying to understand how OnNavigatedTo/OnNavigatingTo should be used. If somebody could phrase a scenario in few words I will understand how to use these methods.
Many thanks in advance