diff --git a/async-from-ui.cs b/async-from-ui.cs new file mode 100644 index 0000000..856643d --- /dev/null +++ b/async-from-ui.cs @@ -0,0 +1,16 @@ +// Basic function handling to having async tasks being run from an interface action in C# WPF. + +private async void Clicked(object sender, RoutedEventArgs e) +{ + await Function(); +} + +public async Task Function() +{ + await Task.Run(async () => + { + await someCommand(); + }); + + UI_things(); +} \ No newline at end of file