var geolocator = new Geolocator(); geolocator.DesiredAccuracyInMeters = 50; geolocator.PositionChanged += Geolocator_PositionChanged; private async void Geolocator_PositionChanged(Geolocator sender, PositionChangedEventArgs args) { var position = args.Position; // Use the updated position here } var position = await geolocator.GetGeopositionAsync(); // Use the initial position here
var geolocator = new Geolocator(); var position = await geolocator.GetGeopositionAsync(); // Reverse geocode the current position var geopoint = position.Coordinate.Point; var mapLocationFinderResult = await MapLocationFinder.FindLocationsAtAsync(geopoint); if (mapLocationFinderResult.Status == MapLocationFinderStatus.Success && mapLocationFinderResult.Locations.Count > 0) { var address = mapLocationFinderResult.Locations[0].Address; // Use the address information here }Package library: This library is provided by Microsoft and is part of the Windows Runtime API. It is included by default in Universal Windows Platform (UWP) applications and can be used in any C# project targeting the Windows platform.