예제 #1
0
 public void SetIsPermissionGrantedWhenRequested(bool isPermissionGranted)
 {
     _isPermissionGrantedWhenRequested = isPermissionGranted;
     if (_isPermissionRequested)
     {
         LocationPermissionChanged?.Invoke(this, new LocationPermissionChangedEventArgs(_isPermissionGrantedWhenRequested));
     }
 }
예제 #2
0
        public async Task <bool> RequestPermission(CancellationToken ct)
        {
            if (!_isPermissionRequested)
            {
                _isPermissionRequested = true;

                if (_isPermissionGrantedWhenRequested)
                {
                    LocationPermissionChanged?.Invoke(this, new LocationPermissionChangedEventArgs(_isPermissionGrantedWhenRequested));
                }
            }

            return(_isPermissionGrantedWhenRequested);
        }
예제 #3
0
 private void OnStatusChanged(Geolocator sender, StatusChangedEventArgs args)
 {
     LocationPermissionChanged?.Invoke(sender, new LocationPermissionChangedEventArgs(args.Status == PositionStatus.Ready));
 }