public override async void Load(NavigationParameters navigationParameters)
        {
            base.Load(navigationParameters);

            try
            {
                IsMapSelectionEnable = false;
                TextSearched         = "Busque aquí";

                bool permissionsGranted = await _gpsService.GetPermissionsAsync();

                if (permissionsGranted)
                {
                    Coordinates coordinates = await _gpsService.GetCurrentPositionAsync();

                    CenterPosition = new Position(coordinates.Latitude, coordinates.Longitude);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error en Load() en MainPageViewModel:");
                Debug.WriteLine(ex.Message);
            }
            finally
            {
                IsBusy = false;
            }
        }
예제 #2
0
 private async Task GetPositionAsync()
 {
     CurrentPosition = await gpsService.GetCurrentPositionAsync();
 }
예제 #3
0
 private async Task GetPositionAsync()
 {
     var coordinate = await gpsService.GetCurrentPositionAsync();
 }