diff --git a/README.md b/README.md index e02d888..976d2d3 100644 --- a/README.md +++ b/README.md @@ -238,7 +238,7 @@ class DescendantComaprer : IComparer Reactive Extensions with R3 --- -Once the R3 extension package is installed, you can subscribe to `ObserveChanged`, `ObserveAdd`, `ObserveRemove`, `ObserveReplace`, `ObserveMove`, `ObserveReset`, `ObserveClear`, `ObserveReverse`, `ObserveSort` events as Rx, allowing you to compose events individually. +Once the R3 extension package is installed, you can subscribe to `ObserveChanged`, `ObserveAdd`, `ObserveRemove`, `ObserveReplace`, `ObserveMove`, `ObserveReset`, `ObserveClear`, `ObserveReverse`, `ObserveSort`, `ObserveCounteChanged` events as Rx, allowing you to compose events individually. > dotnet add package [ObservableCollections.R3](https://www.nuget.org/packages/ObservableCollections.R3) @@ -260,6 +260,8 @@ list.AddRange(new[] { 10, 20, 30 }); Note that `ObserveReset` is used to subscribe to Clear, Reverse, and Sort operations in bulk. +In addition to `IObservableCollection`, there is also a subscription event for `ISynchronizedView`. In the case of View, `ObserveRejected` is also added. + Since it is not supported by dotnet/reactive, please use the Rx library [R3](https://github.com/Cysharp/R3). Blazor @@ -553,7 +555,7 @@ public enum RejectedViewChangedAction public interface ISynchronizedView : IReadOnlyCollection, IDisposable { object SyncRoot { get; } - ISynchronizedViewFilter Filter { get; } + ISynchronizedViewFilter Filter { get; } IEnumerable<(T Value, TView View)> Filtered { get; } IEnumerable<(T Value, TView View)> Unfiltered { get; } int UnfilteredCount { get; } @@ -562,7 +564,7 @@ public interface ISynchronizedView : IReadOnlyCollection, IDisp event Action? RejectedViewChanged; // int index, int oldIndex(when RejectedViewChangedAction is Move) event Action? CollectionStateChanged; - void AttachFilter(ISynchronizedViewFilter filter); + void AttachFilter(ISynchronizedViewFilter filter); void ResetFilter(); ISynchronizedViewList ToViewList(); NotifyCollectionChangedSynchronizedViewList ToNotifyCollectionChanged(); @@ -611,9 +613,9 @@ When `IsReverse` is true, you need to use `Index` and `Count`. When `IsSort` is For Filter, you can either create one that implements this interface or generate one from a lambda expression using extension methods. ```csharp -public interface ISynchronizedViewFilter +public interface ISynchronizedViewFilter { - bool IsMatch(T value); + bool IsMatch(T value, TView view); } public static class SynchronizedViewExtensions @@ -621,6 +623,10 @@ public static class SynchronizedViewExtensions public static void AttachFilter(this ISynchronizedView source, Func filter) { } + + public static void AttachFilter(this ISynchronizedView source, Func filter) + { + } } ``` @@ -644,6 +650,11 @@ public interface IWritableSynchronizedView : ISynchronizedView ToWritableViewList(WritableViewChangedEventHandler converter); INotifyCollectionChangedSynchronizedViewList ToWritableNotifyCollectionChanged(WritableViewChangedEventHandler converter); INotifyCollectionChangedSynchronizedViewList ToWritableNotifyCollectionChanged(WritableViewChangedEventHandler converter, ICollectionEventDispatcher? collectionEventDispatcher);