Ivan

Ivan

  • NA
  • 29
  • 5.7k

don't understand INotification and event

Apr 29 2011 3:12 AM
Hello to everybody...

I've been trying to understand how to use INotifyPropertyChanged interface inside a class that i'm using but i have a problem understanding the link between the event raised inside the class e the INotifyPropertyChanged that, from what i understood, is sent to the UI...

So i have a class with a property that can have two values (two string: "EXP" and "INS")...

Depending on the value of this property I need to use a different list and different constants inside the logic of the class, but since the information about that property will be helpful also in the UI i thought that would have been a good idea to sue the INotifyPropertyChanged inside the class....

Just i don't get if I need to create an event for what i have to use inside the class AND INotifyPC for the UI, or if it'ìs possible to use simply INotifyPC to achieve both things....

if the class has the structure suggesting by MSDN

public event PropertyChangedEventHandler PropertyChanged;

public string myProperty { get { return name; } set { name = value; OnPropertyChanged(String); } }

Where exactly i should subscribe this event in order to modify other property inside my class (like which list i'm using, which constants, etc...)

Thanks a lot, I.


Answers (21)