hi
i've created custom collection which implements INotifyCollectionChanged
here is sensible part
public event NotifyCollectionChangedEventHandler CollectionChanged;
public void Add(T item)
{
if (_innerCollection.Add(item))
{
if(CollectionChanged != null)
CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item)); //i've checked, this code executes
}
}
i populate it, then i create ListView and add button code
var listView = new ListView {ItemsSource = myCollection};
....
button.Clicked += (sender, args) =>
{
myCollection.Add (new MyType{ Id = "3", Title = "Added" });
};
now, after i press the button, ListView becomes empty;
if i hook standart collection, all works well
private ObservableCollection myCollection = new ObservableCollection();
i see, that ListView only listens to CollectionChanged event and no other.
what's my problem? o_O
(everything is on one thread as far as i see. i don't create any other)