Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private async Task GetDataAsync() {
- var task1 = ReadDataFromIOAsync();
- var task2 = ReadDataFromIOAsync();
- // Here we can do more processing
- // that doesn't need the data from the previous calls.
- // Now we need the data so we have to wait
- await Task.WhenAll(task1, task2);
- // Now we have data to show.
- lblResult.Content = task1.Result;
- lblResult2.Content = task2.Result;
- }
- private async Task GetDataAsync() {
- var task1 = ReadDataFromIOAsync();
- var task2 = ReadDataFromIOAsync();
- lblResult.Content = await task1;
- lblResult2.Content = await task2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement