Navigation
The overarching goal of this book is to show how you can build a solid architecture based on design patterns and best practices; the objective of this chapter is to take our TripLog app one step closer to achieving that goal. By introducing MVVM into our TripLog app in Chapter 2, MVVM and Data Binding, we set up the app with a very clear pattern to separate the user interface from the rest of the logic in the app. Each subsequent chapter, starting with this one, further advances this concept of separation.
In Chapter 2, MVVM and Data Binding, we moved a large portion of the app logic into ViewModels; however, navigation is still being initiated from the Pages (Views). In this chapter, we will create a navigation service that we can use to refactor any navigation logic out of the Page-level code and into the ViewModels. While doing this will not result in any noticeable differences when running the app, it will allow us to make navigation fit more naturally into the...