When to use invoke and begininvoke in wpf
Loading
When to use invoke and begininvoke in wpf
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sachin SinghPosted Jun 17, 2021, 9:37 AM
Control.Invoke: Executes on the UI thread, but calling thread waits for completion before continuing.Control.BeginInvoke: Executes on the UI thread, and calling thread doesn't wait for completion.Delegate.Invoke: Executes synchronously, on the same thread.Delegate.BeginInvoke: Executes asynchronously, on athreadpoolthread.credit:- https://stackoverflow.com/questions/229554/whats-the-difference-between-invoke-and-begininvoke
Rajanikant HawaldarPosted Jun 17, 2021, 9:45 AM
Invoke is Synchronous whereas BeginInvoke is Asynchronous, which means in case of Invoke, control will not
return to the calling object until the callback returns. If you are OK with blocking calls, then you can choose Invoke.
create one simple app add
one textbox and enter some text and add two buttons and see how threads are working.
PatelPosted Jun 17, 2021, 9:42 AM