O'Reilly logo

Programming Reactive Extensions and LINQ by Paul Betts, Jesse Liberty

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

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: ...

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