/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached.
/// This parameter is typically used to configure the page.</param>
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
//Wait for the data to be loaded from the HSL webservice
try
{
await App.VehicleViewModel.LoadVehicleDetails();
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
//Get the geolocation of the phone to display in the map
Geolocator geolocator = new Geolocator();
Geoposition geoposition = null;
try
{
geoposition = await geolocator.GetGeopositionAsync();
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
hslMapControl.Center = geoposition.Coordinate.Point;
hslMapControl.ZoomLevel = 15;
InitiateRefreshTimer();
}