Creating and implementing the NavigationService interface
In this section, we will take a look at how to create the INavigationService
class, which will essentially contain various instance methods that will be used by our BaseViewModel
class, that each of our ViewModels
class constructors will implement in the INavigationService
interface. The advantage of creating an INavigationService
class is that it's much easier to add additional class instance methods that will be used by those ViewModels that utilize this interface.
Let's start by creating the NavigationService
class for our TrackMyWalks
app by performing the following steps:
- Ensure that the
TrackMyWalks
solution is open within the Visual Studio for Mac IDE.
- Next, right-click on the
TrackMyWalks
project, and chooseAdd|New Folder
from the pop-up menu, as shown in the following screenshot:

Creating the Services folder within the TrackMyWalks project
- Then, enter
Services
for the name of the new folder to be created, right-click on theServices...