I have to build a chat application in WPF; I want to use DataBinding (still learning) and want to do it right. I built the Buddy class this way:
public class Buddy: INotifyPropertyChanged { private String _name; private String _status; public String Name { get { return _name; } set { _name = value; NotifyPropertyChanged("Name"); } } public String Status { get { return _status; } set { _status = value; NotifyPropertyChanged("Status"); } } public event PropertyChangedEventHandler PropertyChanged; protected void NotifyPropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } }
I do not know what is the best way to deal with BuddyList. Should I create a BuddyList class using the Add and List method and then DataBinding for an instance of this class? What is the best way to do this?
source share