private void setRoverPinLocation()
{
bool messageReceived = false;
var startTime = DateTime.UtcNow;
roverCoordinates = new GPSCoordinates();
roverPin = new Pushpin();
//Wait for the StatusUpdater to send the location of the rover BEFORE the pushpin is set, or else DataBinding will not occur
while (roverCoordinates.Location == null && (DateTime.UtcNow - startTime < TimeSpan.FromSeconds(2)))
{
//loop until the rover coordinates have been received, timeout after 2 seconds
messageReceived = true;
}
//if the message was successfully received, bind the location
if (messageReceived)
{
roverPin.Location = roverCoordinates.Location;
formatRoverPin();
}
}