Skip to content

Dispatcher.Invoke API Change in v11 #9329

Answered by hez2010
mysteryx93 asked this question in Q&A
Discussion options

You must be logged in to vote

If you want to workaround InvokeAsync<T> for IDispatcher, you can use TaskCompletionSource<T>:

var tcs = new TaskCompletionSource<T>();
_ = dispatcher.InvokeAsync(() => 
{
    // ...
    tcs.SetResult(...);
}, ...);
var result = await tcs.Task;

Replies: 12 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by timunie
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
6 participants
Converted from issue

This discussion was converted from issue #9024 on November 02, 2022 12:41.