Imagine a WPF code-behind event handler:
<Button Click="OnButtonClick" />
In C# 4 you would declare your handler as:
private void OnButtonClick(object sender, RoutedEventArgs e) { ... }
In C# 5 you can declare an async
handler
private async void OnButtonClick(object sender, RoutedEventArgs e) { ... }
So what is WPF doing with this? A few minutes of searching about didn't turn anything up.
It seems that it's possible to perform UI updates after await
statements. Does this imply that the task is continued on the Dispatcher thread?
If the Task
raised an error, would it be raised through the WPF Dispatcher
, or only via the TaskScheduler
?
Are there any other interesting aspects to this that might be nice to understand?