You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Over the years I see this trip up a lot of devs -- especially with code coming from WPF. Latest here #18670
In WPF when the binding system subscribes to PropertyChanged/CollectionChanged events on ViewModels and their properties it will also make sure to Marshall the handlers to the UIThread.
This seems to make a lot of sense as we know bindings are for the UI. It also cleans up some cases in ViewModels where you can just use Tasks and background threads to update properties without having to marshall into the UI thread yourself.
Invoking code from the ViewModel on the UIThread also will require getting references it really shouldn't when we switch to multiple UIThreads.
Can this be changed to work like WPF? Especially with #18586.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Over the years I see this trip up a lot of devs -- especially with code coming from WPF. Latest here #18670
In WPF when the binding system subscribes to PropertyChanged/CollectionChanged events on ViewModels and their properties it will also make sure to Marshall the handlers to the UIThread.
This seems to make a lot of sense as we know bindings are for the UI. It also cleans up some cases in ViewModels where you can just use Tasks and background threads to update properties without having to marshall into the UI thread yourself.
Invoking code from the ViewModel on the UIThread also will require getting references it really shouldn't when we switch to multiple UIThreads.
Can this be changed to work like WPF? Especially with #18586.
Beta Was this translation helpful? Give feedback.
All reactions