Creating Observables from Events

One of the fascinating ways you can create an observable collection is from a series of events. In this way the keyboard or mouse can be thought of as a collection of key-presses or mouse movements, respectively.

Example: Searching Wikipedia

A series of events can easily be turned into an observable collection using the FromEvent construct. Once more, an example is worth a thousand words, so in our next example, we're going to walk you through an app that makes use of an observable collection of events to capture the user's input and to search Wikipedia with whatever the user has typed. Figure 3-2 shows the output to expect when you run the program.

To get started, open Visual Studio and create a new Windows Phone ...

Get Programming Reactive Extensions and LINQ 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.