Reputation: 5236
I have moved my project to prism 7.2
I have quite a few "OnNavigatingTo" and replaced accordingly with InitializeAsync or Initialize
If I remember correctly "OnNavigatingTo" was firing every time you navigated to a page whether to or back. If I was navigating back to a page it would fire whilst Initialize doesn't.
This whether correct or wrong is causing me issues with some of my pages where I was passing back parameters when navigating back .
Is this the intended behavior?
thanks
Upvotes: 0
Views: 437
Reputation: 5799
OnNavigatingTo was only ever supposed to fire once. It's intent was to initialize. There ended up being cases where it fired more than once. Anything you require done once should be placed in IInitialize.Initialize
anything that should be fired each time you navigate or requires some logic like Navigated Back to... should be in INavigat[ed|ion]Aware.OnNavigatedTo
.
It was this confusion that led so many Prism users to request that the support be dropped and a new API be introduced that made the intent clearer.
Upvotes: 1