From b59623ae38a762f03f29985efac2662f4eb4538c Mon Sep 17 00:00:00 2001 From: neuecc Date: Wed, 22 Sep 2021 20:22:00 +0900 Subject: [PATCH] r --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d61232e..f770e15 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ static void List_CollectionChanged(in NotifyCollectionChangedEventArgs e) } ``` -Handling All CollectionChanged event manually is difficult. ObservableCollections has SynchronizedView that transform element for view. +Handling all `CollectionChanged` event manually is hard. We recommend to use `SynchronizedView` that transform element and handling all collection changed event for view synchronize. ```csharp var list = new ObservableList(); @@ -122,7 +122,7 @@ public partial class DataTable : ComponentBase, IDisposable public IReadOnlyList Items { get; set; } = default!; [Parameter, EditorRequired] - public Func DataTemplate { get; set; } + public Func DataTemplate { get; set; } = default!; ISynchronizedView view = default!; @@ -139,6 +139,7 @@ public partial class DataTable : ComponentBase, IDisposable view = freezedList.CreateView(DataTemplate); } + // TODO: what do. view.CollectionStateChanged += async _ => { await InvokeAsync(StateHasChanged);