In my Windows Phone 8 app, I am trying to use GetGeopositionAsync on the main page to display some items based on user location.
Calling GetGeopositionAsync does not
This weird behaviour happens when the status of geolocator
is in NotInitialized
state while calling the GetGeopositionAsync()
.
The geolocator
is only Ready
in two cases. One, when it is subscribed to a PositionChanged
event. Two, when a GetGeopositionAsync()
is called already.
So, you just have to subscribe the geolocator
to a positionChanged
event before calling the GetGeopositionAsync()
.
Hope this helps.