Now that we have updated our WalkEntryPageViewModel ViewModel so that it can communicate with our LocationService class to obtain the current GPS Latitude and Longitude coordinates of the device, we can now proceed to start updating the WalkDistancePageViewModel class. We are doing this so that it can use our location service to obtain the current GPS device location, as well as handle checking for changes in GPS location in the background and raising an EventHandler containing the updated coordinates that we can reference within our WalkDistancePage.xaml.cs code-behind file.
Let's take a look at how we can achieve this by following these steps:
- Ensure that the WalkDistancePageViewModel.cs file is displayed within the code editor and enter the following highlighted code sections within the code snippet:
//
// WalkDistancePagePageViewModel...