Пример #1
0
        /// <summary>
        /// Notifies the location update.
        /// </summary>
        /// <param name="locationArgs">Location arguments.</param>
        protected void NotifyLocationUpdate(LocationUpdatedEventArgs locationArgs)
        {
            var location = locationArgs.Location;

            var newLocation = new Location()
            {
                Longitude = location.Longitude,
                Latitude  = location.Latitude,
                Timestamp = DateTime.Now,
            };

            CurrentLocation = newLocation;

            Locations.Add(newLocation);
            LocationUpdate?.Invoke(this, newLocation);
            // stop any more location updates
            LocationManager.Stop();

            LocationLoading = false;
        }