I suspect that INotify... is not correctly implemented? I just tested:
l = new ObservableCollection<MyClass>();
l.Add(new MyClass() { Name = "A" });
l.Add(new MyClass() { Name = "B" });
l.Add(new MyClass() { Name = "C" });
cmb.ItemsSource = l;
and then, on a button click:
l[0].Name = "Robert";
works just fine. My combobox:
<ComboBox x:Name="cmb" SelectedValuePath="Name" DisplayMemberPath="Name" />
and finally, my class:
class MyClass : INotifyPropertyChanged
{
private string _name;
public string Name
{
get
{
return _name;
}
set
{
string oldval = _name;
_name = value;
if (!string.Equals(oldval, _name))
{
OnPropertyChanged("Name");
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string name)
{
var ev = PropertyChanged;
if (ev != null)
{
ev.Invoke(this, new PropertyChangedEventArgs(name));
}
}
}