Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In order to simulate use of the location service, you will be intercepting GeoCoordinateWatcher's PositionChanged event using an Observable object. With an Observable object, you can subscribe to an event and then stream the data received to the subscribed event delegates. For the examples in this chapter, you will subscribe to the PositionChanged event to feed GPS data to the parts of your application that consume it. The use of Observable objects is covered in more detail in Chapter 18.
To set up the GeoCoordinateWatcherDemo project, follow the steps from the previous examples in this book. In order to use a .NET reactive extension (Chapter 18), you will need to add a reference to Microsoft.Phone.Reactive. You'll also need to reference System.Device in order to use the location service, and more importantly, System.Observable, in order to feed GPS data to the location service.