Creating and implementing the ILocationService interface
In this section, we'll take a look at how to create the ILocationService
class, which will essentially contain various instance methods that will be used by our LocationService
class. The advantage of creating an ILocationService
class is that it's much easier to add additional class instance methods that will be used by those ViewModels and ContentPages (Views) that utilize this interface.
Let's start by creating the ILocationService
interface 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
Services
folder, and chooseAdd|New File...
from the pop-up menu, as shown in the following screenshot:

Creating a New File within the Services Folder
- Next, choose the
Empty Interface
option under theGeneral
section and enterILocationService
for the name of the interface to be created, as shown in the following screenshot:

Creating...