I've got quite simple problem but gives me a headache and I'm wasting too much time. I've ran out of ideas anyway:)
For some reason I can't pass the value of my property variable to my event handler. Here is what I've got , an for me everything is fine but it won't work:(

Any idea why it's not passing the actual value of the variable? Thanks in advance:)
Just as the name suggests,
propertyNameshould contain the property's name, not value. Also see PropertyChangedEventHandler and PropertyChangedEventArgs on MSDN for more details.As to why your event handler
null, I suspect you haven't subscribed to it. You should have something like the following somewhere in your program:then when
obj.Moveschangesobj_PropertyChangedwill be called.I understand your confusion, so let me give a little more explanations. Suppose you have two classes
AandB, and you wantBto be notified when a property ofAis changed. Then you can makeAimplement INotifyPropertyChanged, and makeBsubscribe to the PropertyChanged event ofA, like the following:With the above,
B.a_PropertyChangedwill be called wheneverA.Movesis changed. More precisely, ifbis an instance ofB, thenb.a_PropertyChangedwill be called wheneverb.a.Movesis changed. Also please note how my implementation of the setter ofMovesdiffers from yours.