GetGeolocation() { Geolocator _geolocator = new Geolocator(); MapLocation MAPINFO </跨度> = null;
_geolocator.DesiredAccuracyInMeters = 5;
尝试 { 地理位置……
你必须确保这一点 的 位置能力 强> 使用您的清单(Package.appxmanifest文件)设置:
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp"> // You should have this <Capabilities> <DeviceCapability Name="location"/> </Capabilities> </Package>