using System; using System.ComponentModel; namespace Samples.TodoListModule { public class Todo : INotifyPropertyChanged { private string _description; private Guid _id = Guid.Empty; private bool _isDone; private string _name = "New Todo"; public Guid Id { get { return _id; } set { _id = value; } } public string Name { get { return _name; } set { _name = value; OnPropertyChanged("Name"); } } public string Description { get { return _description; } set { _description = value; OnPropertyChanged("Description"); } } public bool IsDone { get { return _isDone; } set { _isDone = value; OnPropertyChanged("IsDone"); } } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion public override bool Equals(object obj) { Todo other = obj as Todo; if(other != null) return other.Id == Id; else return false; } protected virtual void OnPropertyChanged(string propertyName) { if(PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } }