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()
{
CurrentViewModel = null;
Task.Run(async () => await LongDelay()).ContinueWith(c =>
{
System.Diagnostics.Debug.WriteLine(c.Result);
CurrentViewModel = new Part2ViewModel();
Task delay = Task.Run(LongDelay).ContinueWith(c =>
{
System.Diagnostics.Debug.WriteLine(c.Result);
CurrentViewModel = new Part2ViewModel();
}, 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()