I've been playing around with Xamarin.Forms (using the PCL project template), and ran into the following issue.
var food = new Button { Text = "Food" };
Task.Run(async () =>
{
Debug.WriteLine("starting a delay");
await Task.Delay(1000);
food.BackgroundColor = Color.Black;
Debug.WriteLine("done");
});
This sample code just freezes on the Task.Delay forever. If I try to change the await for ContinueWith like the following it will crash the compiler
await Task.Delay(1000).ContinueWith(() => Debug.WriteLine("done delaying"));
with the following error message https://gist.github.com/darthdeus/75718d98fc2b5635b48f. Am I doing something wrong? Should I even be using Async/await in the PCL? Or should I just use the shared library instead?