For the March 2010 version of Rx, the code needs to be adjusted as follows:

 

 Observable.Start(() =>
                        {
                            Thread.Sleep(3000);
                            //return "Hello World";
                        }).ObserveOnDispatcher().Subscribe(_ => button.Content = "Hello World");

Note the addition of ObserveOnDispatcher above as compared to its absence in the video.

 

Lastly, the original code:

 

ThreadPool.QueueUserWorkItem(_ =>
                        {
                            Thread.Sleep(3000);
                            button.Dispatcher.BeginInvoke(() =>
                                {
                                    button.Content = "Hello World!";
                                });
                        }, null);

Is quite terse as well.  Compared to my revised version, I'm not sure the character count is all that different.

 

Nice Rx sample.  Qualifies as the "Hello World!" of Rx for Silverlight and other ilks ... here's a console app version:

 

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Creating ...");

            var o = Observable.Start(() =>
            {
                Console.WriteLine("Calculating...");
                Thread.Sleep(3000);

            }).Subscribe(_ => Console.WriteLine("Hello World!"));

            Console.WriteLine("Created ...");

            Console.WriteLine("Starting ...");

            Console.ReadKey();
        }
    }
}

 

For WPF its:

<!-- Window1.xaml -->

<Window x:Class="HelloWorld.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">
    <Grid>
     <Button x:Name="button" Margin="63,47,77,0" VerticalAlignment="Top" Height="60" Content="Button"/>
    </Grid>
</Window>

 

// Window1.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Threading;

namespace HelloWorld
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
   
   button.Click += (o, e) =>
   {
    // button.Content = "Hello World";
    
    Observable.Start(() =>
    {
     Thread.Sleep(3000);
    }).ObserveOnDispatcher().Subscribe(_ => button.Content = "Hello World!");
   };
        }
    }
}

 

All very similar.  Now all we need is the Winforms variations.