Exemplo n.º 1
0
        private async Task InitLocation()
        {
            tbLocationStatus.Text = "定位中...";
            KeyValuePair <GeolocationAccessStatus, string> addressPair = await location.GetLoacationAsync();

            if (addressPair.Key == GeolocationAccessStatus.Allowed)
            {
                tbLocationStatus.Text = addressPair.Value;
            }
            else if (addressPair.Key == GeolocationAccessStatus.Denied)
            {
                tbLocationStatus.Text = "最远的距离就是:我不知道你身在何处。修改定位选项:";
            }
            else if (addressPair.Key == GeolocationAccessStatus.Unspecified)
            {
                tbLocationStatus.Text = "我对你的定位出了一丢丢的问题~";
            }
        }