Merge pull request #62 from zerodev1200/Add-INotifyCollectionChangedSynchronizedView.Refresh()

Add INotifyCollectionChangedSynchronizedView.Refresh()
This commit is contained in:
Yoshifumi Kawai 2024-08-28 16:03:30 +09:00 committed by GitHub
commit 9109711524
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -59,6 +59,7 @@ namespace ObservableCollections
public interface INotifyCollectionChangedSynchronizedView<out TView> : IReadOnlyCollection<TView>, INotifyCollectionChanged, INotifyPropertyChanged, IDisposable public interface INotifyCollectionChangedSynchronizedView<out TView> : IReadOnlyCollection<TView>, INotifyCollectionChanged, INotifyPropertyChanged, IDisposable
{ {
void Refresh();
} }
public static class ObservableCollectionsExtensions public static class ObservableCollectionsExtensions

View File

@ -131,6 +131,11 @@ namespace ObservableCollections.Internal
self.PropertyChanged?.Invoke(self, CountPropertyChangedEventArgs); self.PropertyChanged?.Invoke(self, CountPropertyChangedEventArgs);
} }
} }
public void Refresh()
{
OnCollectionChanged(new SynchronizedViewChangedEventArgs<T, TView>(NotifyCollectionChangedAction.Reset));
}
} }
internal class ListNotifyCollectionChangedSynchronizedView<T, TView> internal class ListNotifyCollectionChangedSynchronizedView<T, TView>