Add INotifyCollectionChangedSynchronizedView.Refresh()

This commit is contained in:
zero 2024-08-26 18:28:11 +09:00
parent d7fac361bd
commit d8b0d8f117
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>