-
What is the "Prism way" of knowing what View\ViewModel I came from? Is there a way of knowing it was Back navigation or Forward I know I could just roll-my-own solution and in this specfic scenario do something like
But I wanted to know if there was a more Prism correct way of doing it |
Beta Was this translation helpful? Give feedback.
Answered by
dansiegel
May 15, 2024
Replies: 1 comment 5 replies
-
public void OnNavigatedTo(INavigationParameters parameters)
{
if (parameters.GetNavigationMode() == NavigationMode.New)
{
// Will happen the first time the view is navigated to
}
else
{
// will happen any time the View is navigated back to
}
} |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would seem to me that this is just a tight coupling and bad design. Your ViewModel should only care about the state that it is either passed via NavigationParameters or via services that you may have.
For example: