Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: BindingListCollectionView item replace issue (#1314) #2924

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,18 @@ private void OnListChanged(object sender, ListChangedEventArgs args)
break;

case ListChangedType.ItemChanged:
// if there is no PropertyDescriptor, then ItemChanged refers to a Replace event
// (IBindingList indexer set) and not a property change of an item
if (args.PropertyDescriptor == null)
{
item = InternalList[index];
var oldItem = _cachedList[index];
_cachedList[index] = item;
forwardedArgs = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, item, oldItem, index);
break;
}

// here ItemChange refers to a property change
if (!_itemsRaisePropertyChanged.HasValue)
{
// check whether individual items raise PropertyChanged events
Expand Down