If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

NotifyPropertyChanged VS DependencyObjects

Hi, i'm a WPF newbie. I'm trying to learn it as a matter of fact :-)

If you have binding between a textbox.text and the name property of your employee class, then you have to add code if you want the textbox.text property to be updated when another process changes the name property. You can do this by letting the employee class implement the INotifyPropertyChanged and let the binded properties know Name has changed.

You can also do this by letting the Employee class inherit from DependencyObject. If you then use the SetValue in your Name property, you get the same effect as with notifypropertychanged.

Now my question: what is then the difference between the 2 (i know you have extra capabilities with DependencyProperties, zo when should you use notifyPropertyChanged?) Here i have the code that does 2 times the same, but in a different way: