|
|
@ -253,10 +253,9 @@ public class DispatcherOperation<T> : DispatcherOperation |
|
|
{ |
|
|
{ |
|
|
get |
|
|
get |
|
|
{ |
|
|
{ |
|
|
if (TaskCompletionSource.Task.IsCompleted) |
|
|
if (TaskCompletionSource.Task.IsCompleted || !Dispatcher.CheckAccess()) |
|
|
return TaskCompletionSource.Task.GetAwaiter().GetResult(); |
|
|
return TaskCompletionSource.Task.GetAwaiter().GetResult(); |
|
|
throw new InvalidOperationException("Synchronous wait is only supported on non-UI threads"); |
|
|
throw new InvalidOperationException("Synchronous wait is only supported on non-UI threads"); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -306,4 +305,4 @@ public enum DispatcherOperationStatus |
|
|
Aborted = 1, |
|
|
Aborted = 1, |
|
|
Completed = 2, |
|
|
Completed = 2, |
|
|
Executing = 3, |
|
|
Executing = 3, |
|
|
} |
|
|
} |
|
|
|