I faintly remember there being a property that tells us whether a task executed synchronously but my memory fails me just now. Or may be there isn't and I am mixing up the
It's description looks much like the answer:
Gets an indication of whether the operation completed synchronously.
In order to check the property value you will have to cast the
IAsyncResult because the
Task implements it explicitly.
bool? result = (myTask as IAsyncResult)?.CompletedSynchronously;
Instead of the explicit cast you can use the extension method: WindowsRuntimeSystemExtensions.AsAsyncOperation defined in the
bool result = myTask.AsAsyncOperation().CompletedSynchronously;
As reasonably pointed out in the comment though there is a gag in the current property implementation. As of the first of October 2016 it always returns
false. This is a subject to change.