Using Thread.Sleep in Xamarin.Forms : <p>I want to execute the following</p>

<pre><code>MainPage = new ContentPage
{
    Content = new StackLayout
    {
        Children =
        {
            new Button
            {
                Text = "Thread.Sleep",
                Command = new Command(() =&gt;
                {
                    Thread.Sleep(1000);
                    MainPage.Animate("", x =&gt; MainPage.BackgroundColor = Color.FromRgb(x, x, x));
                }),
            },
            new Button
            {
                Text = "Task.Run + Thread.Sleep",
                Command = new Command(async () =&gt;
                {
                    await Task.Run(() =&gt; Thread.Sleep(1000));
                    MainPage.Animate("", x =&gt; MainPage.BackgroundColor = Color.FromRgb(x, x, x));
                })
            },
            new Button
            {
                Text = "Device.StartTimer",
                Command = new Command(() =&gt; Device.StartTimer(
                    TimeSpan.FromSeconds(1),
                    () =&gt;
                    {
                        MainPage.Animate("", x =&gt; MainPage.BackgroundColor = Color.FromRgb(x, x, x));
                        return false;
                    })),
            },
        }
    }
};
</code></pre>

<p>I included <code>System.Threading</code> and <code>System.Threading.Tasks</code>, but I still get</p>

<blockquote>
  <p>The name 'Thread' does not exist in the current context.</p>
</blockquote>

<p><a href="http://www.xforms-kickstarter.com/#timer-never-miss-an-action" rel="noreferrer">This site</a> suggests that <code>Thread.Sleep</code> can be used in <code>Xamarin.Forms</code>. I have this in a shared project, not a PCL.</p>
