I prefer ViewModel first approach. That means navigation service take viewmodel as a parameter and then, based on naming convention, instance of view is created and loaded into frame.
navigationService.Navigate<SomePageViewModel>()
This has couple of advantages over URI based navigation, which is view first approach:
- Better testability
- possibility of dependency injection into view
- most important: Better maintability. If you rename or move your pages, this will won't compile until you fix it, unlike URIs. Uri's would throw error at runtime
Unfortunelly, I can't give you mine example project right now, but it's quite easy to implement your own
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…