I have been asked this question in an interview

"When we want to reflect the changed value of a propery on the view when some updates the binded propery in backend in ViewModel, then we generally raise the event which is given by implementing INofityPropertyChanged interface."

"So, question is this we dont bind any event handler to propertychanged event, it is the wpf run time that does it. So, what exactly happens right after raising the propertychanged event from ViewModel.

1

There are 1 answers

0
Bill Zhang On

In WPF, Dispatcher handles most(maybe all) UI work items in loops, like queues. Different work items have different priorities so that Dispatcher can handle some items with very high priority in time.

Raising a property changed event will transfer to a data binding task and will be put in Dispatcher's queue with DataBinding priority. Dispatcher will manage the item's position inside the queue and execute it, which is to update data binding here, at an appropriate time.