It does not need the async/await
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user