O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting Started with Rx for Windows Phone

Rx types reside in the Microsoft.Phone.Reactive namespace.

The key to using Rx is to understand the two principal interfaces: IObserver and IObservable. Rx’s IObservable and IObserver are analogous to IEnumerable and IEnumerator, except for one key difference: They do not block.

Rx allows you to create an IObservable object from an event. In the following excerpt, an IObservable is created using the IGeoLocator instance’s PositionChanged event:

IObservable<IEvent<PositionChangedProxyEventArgs>> observable    = Observable.FromEvent<GeoPositionChangedProxyEventArgs>(        ev => geoLocator.PositionChanged += ev,        ev => geoLocator.PositionChanged -= ev);

By supplying ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required