Skip to content

Question regarding ConfigureAwait(false) #38

Answered by brminnick
MartyIX asked this question in Q&A
Discussion options

You must be logged in to vote

Good question!

Short answer: Yes, in .NET MAUI it's safe to update properties in the ViewModel that are bound to the view from any thread.

.NET MAUI (and Xamarin.Forms) marshall binding updates to the Main (UI) Thread, so we're totally safe setting a property in our ViewModel from any thread because MAUI's binding engine will bring the updates to the UI Thread for us.

You'll want to stay aware around this, though. There has been talks amongst the engineering team to no longer marshall every binding to the UI Thread, and I've seen some instances in newer versions of .NET MAUI where it wasn't properly marshaling CollectionView updates to the UI Thread. It'd be a substantial breaking change,…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@MartyIX
Comment options

@MartyIX
Comment options

@brminnick
Comment options

Answer selected by brminnick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #37 on November 01, 2022 19:14.