Skip to content

Region lifetime #2458

Answered by Tum4ik
Tum4ik asked this question in Xamarin.Forms
May 25, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

I have found the answer on my question. I should use IRegionAware interface for my region view model and return true from the IsNavigationTarget method.

public bool IsNavigationTarget(INavigationContext navigationContext)
{
    return true;
}

Then Prism stops to create new instance of the region view model each time I navigate to it.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Tum4ik
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Tum4ik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants