When is MainThread/Dispatcher required?

Platform: .NET MAUI| Category: Navigation

Any UI update from a background thread must run on the main thread. Prefer MainThread.InvokeOnMainThreadAsync when you need to await completion.

MainThread example: 

await MainThread.InvokeOnMainThreadAsync(() => label.Text = "Updated");

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.