Try to understand WPF. This is my test classes:
public partial class MainWindow : Window, INotifyPropertyChanged
{
private ObservableCollection
The problem is that you are directly setting the original list onto the Window.DataContext
, so nothing ever listens to the windows' PropertyChanged
event.
To solve this, set the DataContext
to the window itself:
this.DataContext = this;
and then change the Binding
so refer to the property:
<ComboBox ItemsSource="{Binding MyList}" />
You will also need to change your property definition so that it raises the name of the property being changed, not the name of the member:
this.RaisePropertyChanged("MyList");
I think you have two problems:
1) binding should be: {Binding MyList}
2) on MyList setter you should use RaisePropertyChanged("MyList");