Merge pull request #27 from Cysharp/hadashiA/fix-missing-property-changed-ev

Fix to emit INotifyCollectionChanged.OnPropertyChanged
This commit is contained in:
Yoshifumi Kawai 2024-02-16 18:01:01 +09:00 committed by GitHub
commit edbaf0bbaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -44,7 +44,7 @@ foreach (var (x, xs) in viewModels)
class ViewModel
{
public int Id { get; set; }
public string Value { get; set; }
public string Value { get; set; } = default!;
}
class HogeFilter : ISynchronizedViewFilter<int, ViewModel>

View File

@ -66,9 +66,11 @@ namespace ObservableCollections.Internal
{
case ChangedKind.Add:
CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, view, eventArgs.NewStartingIndex));
PropertyChanged?.Invoke(this, CountPropertyChangedEventArgs);
return;
case ChangedKind.Remove:
CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, view, eventArgs.OldStartingIndex));
PropertyChanged?.Invoke(this, CountPropertyChangedEventArgs);
break;
case ChangedKind.Move:
CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, view, eventArgs.NewStartingIndex, eventArgs.OldStartingIndex));