public class DataModel
{
public ObservableCollection ValueCollection
{
get;
set;
}
public DataModel()
{
}
}
public class StringItem : INotifyPropertyChanged
{
private string _value;
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged(String info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
#endregion
public Int32 Index { get; set; }
public string Value
{
get { return this._value; }
set
{
if (this._value == value)
return;
this._value = value;
NotifyPropertyChanged("Value");
MessageBox.Show(string.Format("{0:D4}-{1}", Index, Value));
}
}
}