private void Watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
        {
            Debug.WriteLine("Watcher_PositionChanged ({0}, {1})",
            e.Position.Location.Latitude, e.Position.Location.Longitude);

              _currentLocation = new GeoLocation()
              {
            Latitude = e.Position.Location.Latitude,
            Longitude = e.Position.Location.Longitude
              };
        }
        private void Watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
        {
            Debug.WriteLine("Watcher_StatusChanged ({0})", e.Status);

              switch (e.Status)
              {
            case GeoPositionStatus.Disabled:
              _currentLocation = null;
              break;

            case GeoPositionStatus.NoData:
              _currentLocation = null;
              break;
              }
        }
示例#3
0
 public GeoLocationSearchItem(GeoLocation location)
 {
     Location    = location;
     DisplayText = string.Format("{0:F2}, {1:F2}", location.Latitude, location.Longitude);
 }
 private void DoCallback(GeoLocation g)
 {
     if(pendingCallback != null)
     {
         pendingCallback(g);
         pendingCallback = null;
     }
 }
 public GeoLocationSearchItem(GeoLocation location)
 {
     Location = location;
       DisplayText = string.Format("{0:F2}, {1:F2}", location.Latitude, location.Longitude);
 }