I am having a hard time figuring out how to correctly implement navigation in my application.
Think about a simple application with 2 Views:
ShellView: Shows a list of items along with an "Add" button
AddItemView: Shows text boxes to allow the user to enter the data of a new item.
How would I show the AddItemView after a click on the Add button?
I tried using IWindowManager but that doesn't seem to be the correct choice because of the following:
It wants an instance of the ViewModel whose View should be shown. Problem is, the ShellViewModel doesn't have an instance of AddItemViewModel and can't easily create one. I am using a DI container to wire up my dependencies, so I want to avoid newing up
that instance directly in ShellViewModel, because then it would also need to know about all references of AddItemViewModel. I don't want to inject an instance of AddItemViewModel into ShellViewModel because that would mean that every click onto the "Add"
button would show the same instance with all the consequences like stale data in combo boxes that are populated in the constructor.
What am I missing?