Sunday, September 16, 2012

Threads in WinRT

 

Just a small example that shows the use of Task.

private async void Button_Click(object sender, RoutedEventArgs e)
{
    string text = await Task.Run(() => Compute());
    this.TextBlock.Text = text;
}