Working With Location in Windows Phone: Listing 1
Creating the GeoCoordinateWatcher.
- By Nick Randolph
private GeoCoordinateWatcher watcher;
public void StartTracking()
if (watcher == null)
watcher = new GeoCoordinateWatcher();
watcher.StatusChanged += LocationStatusChanged;
watcher.PositionChanged += LocationPositionChanged;
public void StopTracking()
if (watcher != null)
watcher.StatusChanged -= LocationStatusChanged;
watcher.PositionChanged -= LocationPositionChanged;
watcher = null;
Nick Randolph runs Built to Roam, a consulting company that specializes in training, mentoring and assisting other companies build mobile applications. With a heritage in rich client applications for both the desktop and a variety of mobile platforms, Nick currently presents, writes and educates on the Windows Phone platform.