Skip to content

Instantly share code, notes, and snippets.

@bruinbrown
Created November 18, 2013 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bruinbrown/7531377 to your computer and use it in GitHub Desktop.
Save bruinbrown/7531377 to your computer and use it in GitHub Desktop.
Hack to get around broken Geolocator.GetPositionAsync on WP8
private void GetLocation()
{
var locator = new Geolocator();
Geoposition position = null;
try
{
var positionTask = locator.GetGeopositionAsync();
await Task.Delay(200);
positionTask.Cancel();
}
catch (TaskCanceledException ex)
{
}
position = await locator.GetGeopositionAsync();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment