It does not need the async/await

This commit is contained in:
Tracy Pearson
2022-08-12 01:32:31 -04:00
parent d356748444
commit ac7b047983

View File

@@ -27,11 +27,16 @@ namespace WpfViewModelFirst
private void Part1Action() private void Part1Action()
{ {
CurrentViewModel = null; CurrentViewModel = null;
Task.Run(async () => await LongDelay()).ContinueWith(c => Task delay = Task.Run(LongDelay).ContinueWith(c =>
{ {
System.Diagnostics.Debug.WriteLine(c.Result); System.Diagnostics.Debug.WriteLine(c.Result);
CurrentViewModel = new Part2ViewModel(); CurrentViewModel = new Part2ViewModel();
}, TaskContinuationOptions.OnlyOnRanToCompletion); }, TaskContinuationOptions.OnlyOnRanToCompletion);
//Task.Run(async () => await LongDelay()).ContinueWith(c =>
// {
// System.Diagnostics.Debug.WriteLine(c.Result);
//CurrentViewModel = new Part2ViewModel();
//}, TaskContinuationOptions.OnlyOnRanToCompletion);
} }
private async Task<string> LongDelay() private async Task<string> LongDelay()