Skip to content

Commit

Permalink
Merge pull request #27 from Cysharp/hadashiA/fix-missing-property-cha…
Browse files Browse the repository at this point in the history
…nged-ev

Fix to emit INotifyCollectionChanged.OnPropertyChanged
  • Loading branch information
neuecc authored Feb 16, 2024
2 parents 97dafad + 600a300 commit edbaf0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sandbox/ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
class ViewModel
{
public int Id { get; set; }
public string Value { get; set; }
public string Value { get; set; } = default!;
}

class HogeFilter : ISynchronizedViewFilter<int, ViewModel>
Expand All @@ -65,8 +65,8 @@ public void WhenFalse(int value, ViewModel view)
}

public void OnCollectionChanged(
ChangedKind changedKind,
int value,
ChangedKind changedKind,
int value,
ViewModel view,
in NotifyCollectionChangedEventArgs<int> eventArgs)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ public void OnCollectionChanged(ChangedKind changedKind, T value, TView view, in
{
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));
Expand Down

0 comments on commit edbaf0b

Please sign in to comment.