Created
July 29, 2021 01:57
-
-
Save neuecc/e0b8b7c488f58eb004c04dcc5be466cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // similar as ObservableCollection <-> CollectionView | |
| public delegate void NotifyCollectionChangedEventHandler<T>(in NotifyCollectionChangedEventArgs<T> e); | |
| public interface INotifyCollectionChanged<T> | |
| { | |
| event NotifyCollectionChangedEventHandler<T>? CollectionChanged; | |
| ISynchronizedView<T, TView> CreateView<TView>(Func<T, TView> transform, bool reverse = false); | |
| ISynchronizedView<T, TView> CreateSortedView<TView>(Func<T, TView> transform, IComparer<T> comparer); | |
| IGroupedSynchronizedView<T, TKey, TView> CreateGroupedView<TKey, TView>(Func<T, TKey> keySelector, Func<T, TView> transform); | |
| } | |
| public readonly ref struct NotifyCollectionChangedEventArgs<T> | |
| { | |
| public readonly NotifyCollectionChangedAction Action; | |
| public readonly ReadOnlySpan<T> NewItems; | |
| public readonly ReadOnlySpan<T> OldItems; | |
| public readonly int NewStartingIndex; | |
| public readonly int OldStartingIndex; | |
| // ctor() | |
| } | |
| public interface ISynchronizedView<T, TView> : IReadOnlyList<TView>, IDisposable | |
| { | |
| void AttachFilter(Func<T, TView> filter); | |
| void ResetFilter(); | |
| } | |
| public interface IGroupedSynchronizedView<T, TKey, TView> : IGrouping<TKey, TView>, IDisposable | |
| { | |
| void AttachFilter(Func<T, TView> filter); | |
| void ResetFilter(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment