Windows.Devices.Geolocation.Geolocator.GetGeopositionAsync C# (CSharp) Method

GetGeopositionAsync() private method

private GetGeopositionAsync ( ) : IAsyncOperation
return IAsyncOperation
		public extern IAsyncOperation<Geoposition> GetGeopositionAsync();
		[DefaultOverload, Overload("GetGeopositionAsyncWithAgeAndTimeout")]

Same methods

Geolocator::GetGeopositionAsync ( [ maximumAge, [ timeout ) : IAsyncOperation

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            //Wait for the data to be loaded from the HSL webservice
            try
            {
                await App.VehicleViewModel.LoadVehicleDetails();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            //Get the geolocation of the phone to display in the map
            Geolocator geolocator = new Geolocator();
            Geoposition geoposition = null;
            try
            {
                geoposition = await geolocator.GetGeopositionAsync();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
            hslMapControl.Center = geoposition.Coordinate.Point;
            hslMapControl.ZoomLevel = 15;
            InitiateRefreshTimer();
        }
All Usage Examples Of Windows.Devices.Geolocation.Geolocator::GetGeopositionAsync