0
votes

I'm using Prism Regions to navigate my Xamarin Forms App. Everytime I call requestNavigate to a view, a new viewmodel is instantiated. But i would like to reuse the viewmodel.

My viewmodel implements IRegionMemberLifetime and KeepAlive = true;

Also my viewmodel implements INavigationAware, but OnNavigatedFrom or OnNavigatedTo isn't fired when navigating to the viewmodel. I solved this by attaching an eventhandler to

regionManager.Regions["contentRegion"].NavigationService.Navigated 

Can anyone explain me why the regionmanager creates a new instance everytime? I'm using Prism v8, DryIoc v8

1

1 Answers

0
votes

I found it the answer. I didn't implement IRegionAware. Must have overlooked it in the docs.