Skip to content

Commit 53e396d

Browse files
committed
Updates
1 parent d19c41c commit 53e396d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

aspnetcore/blazor/components/virtualization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Modes can be combined. For example, assigning `Beginning | End` pins both edges.
300300

301301
`Virtualize.ItemComparer` gets or sets a comparer used to detect whether items were prepended or appended when using class-typed items with an <xref:Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize%601.ItemsProvider%2A> (for more information, see the [Item provider delegate](#item-provider-delegate) section).
302302

303-
The comparer determines if the first loaded item changed between provider calls, which indicates items were inserted at the top. For records, the default comparer's value-equality behavior (`EqualityComparer<T>.Default`) works automatically. For an in-memory <xref:Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize%601.Items%2A> assignment, an `ItemComparer` comparer isn't required because the component can detect prepends automatically. In cases where non-primative objects are virtualized and the framework can't detect if an item is prepended or appended, assign an item comparer to the `Virtualize` component:
303+
The comparer determines if the first loaded item changed between provider calls, which indicates items were inserted at the top. For records, the default comparer's value-equality behavior (`EqualityComparer<T>.Default`) works automatically. For an in-memory <xref:Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize%601.Items%2A> assignment, an `ItemComparer` comparer isn't required because the component can detect prepends automatically. In cases where non-primative objects are virtualized and the framework can't detect if an item is prepended or appended, assign an <xref:System.Collections.Generic.IEqualityComparer%601> to the `Virtualize` component:
304304

305305
<!-- UPDATE 11.0 - Ilona ... Does the 'itemComparer' in the following example
306306
need the '@' symbol (ItemComparer="@itemComparer")?
@@ -313,8 +313,8 @@ The comparer determines if the first loaded item changed between provider calls,
313313
</Virtualize>
314314
315315
@code {
316-
private static readonly IEqualityComparer<DynamicItem> itemComparer =
317-
EqualityComparer<DynamicItem>.Create((a, b) =>
316+
private static readonly IEqualityComparer<Flight> itemComparer =
317+
EqualityComparer<Flight>.Create((a, b) =>
318318
a.Index == b.Index, item => item.Index);
319319
320320
private async ValueTask<ItemsProviderResult<Flight>> LoadFlights(

0 commit comments

Comments
 (0)