Im a bit confused. I dont understand what code is actually is executed when I implement INotifyPropertyChanged interface.
As i imagine the chain goes like this:
- My class impliments
INotifyPropertyChanged=> - Every property`s setter calls
NotifyPropertyChanged method=> - PropertyChangedEventHandler
invokes=>???
And i wonder what code makes my control rerender.
Thanks.
The control will subscribe to the event when it binds. When you raise the event, the control will check whether the property that’s been changed is one of the ones it cares about. If it is, it will fetch the new value of the property, and rerender itself.
Of course, the handler doesn’t have to be to do with controls rerendering – they can do anything. It’s just a way of saying, “Hey, property X has changed its value… if you care about that, do something.” You can add your own handlers very easily, just like any other event handlers.