Example: Creating Observables

Let's start by creating a reusable application to demonstrate a number of different operators.

Start by creating a new Windows Phone Application. Once it is open, add references to Microsoft.Phone.Reactive and System.Observable.

Add just one control to the XAML file, a ListBox with HorizontalAlignment and VerticalAlignment, both set to stretch and with the name Messages. You will use this to display the output for each iteration of this program.

  <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">    <ListBox       Name="Messages"       HorizontalAlignment="Stretch"       VerticalAlignment="Stretch"       Margin="10" /> </Grid>

Next, add using statements for System and Microsoft.Phone.Reactive, as follows: ...

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.