Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 14: Using Location Services > Simulating the Location Service

Simulating the Location Service

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.

Creating the GeoCoordinateWatcherDemo Project

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint