-
Book Overview & Buying
-
Table Of Contents
Blazor WebAssembly by Example - Third Edition
By :
When you work with a large collection of items, it is often inefficient to render every item in the UI. In these cases, it is much more efficient to render only the subset of items that are currently visible. This technique is called virtualization.
The built-in Virtualize component is used to render only the visible items from a collection. Specifically, it is used when you render a collection of items in a loop and rely on scrolling to limit how many items are visible at any given moment. The Virtualize component calculates which items are visible and only renders those items. Because it avoids rendering items that are off-screen, it is more performant than rendering every item in the collection. It is defined in the Microsoft.AspNetCore.Components.Web.Virtualization namespace.
When using the Virtualize component, all the items must be the same height in pixels. If their heights vary, the scrolling calculations become inaccurate.
The Virtualize<TItem> class...