Sampling the PositionChanged Event with Rx

If the built-in Geolocator class is assigned too low a MovementThreshold value, the event handler for the Geolocator.PositionChanged event may be raised more frequently than needed, which can potentially degrade the performance of your app. The Reactive Extensions (Rx) can eliminate this issue by modulating, or sampling, the event, restricting calls to the PositionChanged event handler to a certain number each second.

Rx is a managed library that has been included as part of the Windows Phone Framework Class Library (FCL). At its essence, Rx allows events to be treated as a data stream. Rx allows you to subscribe to this data stream and to manipulate and filter the data stream before it is handled by ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.