Skip to content

Blazor Virtualize Docs Are Confusing #27537

@richward1

Description

@richward1

Here are the docs for Blazor Virtualize.

Some of the examples around the items provider delegate feel very disjointed, and are confusing.
For example, the following block:

private Virtualize<FetchData>? virtualizeComponent;

protected override void OnInitialized()
{
    WeatherForecastSource.ForcecastUpdated += async () => 
    {
        await InvokeAsync(async () =>
        {
            await virtualizeComponent?.RefreshDataAsync();
            StateHasChanged();
        });
    });
}

Doesn't explain where virtualizeComponent is assigned, or how to hook it up (to presumably a <Virtualize /> component?);

Neither does it explain where the type FetchData has come from (it's only referenced that one time in the entire document), and doesn't seem to follow on from the previous examples.

Context

I'm trying to figure out how to get a virtualized component to show only the items that I've scrolled into view, while the source item list is constantly growing - the default implementation seems to scroll the container when a new item is added. But I'm stuck just trying to follow this bit of the documentation.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions