I made a ListBox in WPF with an ItemSource
and with all those classes and events that make the UI refresh it. But there's a problem in my Remove
method:
Public Sub Remove(ItemIndex As Integer)
MyList.RemoveAt(ItemIndex)
RaiseEvent CollectionChanged(Me, New NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, MyList(ItemIndex)))
End Sub
But when I execute this I get a message that the index (in this case ItemIndex
) is out of range. But in the output window it says that the index is '0' (otherwise it would remove the item from MyList
).