添加的项目未出现在给定索引“2”处
当我尝试从 INotifyCollectionChanged 继承的字典中删除项目时,出现此异常。当我第一次删除时,我能够删除该项目,之后,如果我尝试删除此异常,则当我尝试查看集合时,该项目位于该位置(在本例中为 2)。这里可能出了什么问题。添加发生异常的代码片段
CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, new KeyValuePair(key, value), i));
I am getting this exception when I am trying to Delete the item from Dictionary which I am inheriting from INotifyCollectionChanged. When I am deleting for first time I am able to delete the item, just after that if i am trying to delete this exception comes though when I try to look into the collection the item is there at that position(2 in this case). What could be wrong here. Adding the code snippet where the exception is coming
CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, new KeyValuePair(key, value), i));
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论