Table of Contents

Interface IVirtualScroll

Namespace
Nalu
Assembly
Nalu.Maui.VirtualScroll.dll

A scrollable view that virtualizes its content.

public interface IVirtualScroll : IView, IElement, ITransform
Inherited Members

Properties

Adapter

The adapter that provides data to the virtual scroll.

IVirtualScrollAdapter? Adapter { get; set; }

Property Value

IVirtualScrollAdapter

FadingEdgeLength

Gets or sets the length of the fading edge effect in device-independent units.

double FadingEdgeLength { get; }

Property Value

double

Remarks

A value of 0 means no fading edge is applied (default). The orientation of the fading edge is determined by the layout orientation (horizontal or vertical).

FooterTemplate

Gets or sets the template used to display the footer at the bottom of the scroll view.

DataTemplate? FooterTemplate { get; set; }

Property Value

DataTemplate

HeaderTemplate

Gets or sets the template used to display the header at the top of the scroll view.

DataTemplate? HeaderTemplate { get; set; }

Property Value

DataTemplate

IsRefreshEnabled

Gets or sets a value indicating whether pull-to-refresh is enabled.

bool IsRefreshEnabled { get; set; }

Property Value

bool

IsRefreshing

Gets or sets a value indicating whether the refresh indicator is currently showing. Setting this to true programmatically will trigger the refresh indicator. Setting this to false will stop the refresh indicator.

bool IsRefreshing { get; set; }

Property Value

bool

ItemTemplate

Gets or sets the template used to display each item.

DataTemplate? ItemTemplate { get; set; }

Property Value

DataTemplate

ItemsLayout

Gets or sets the layout for the virtual scroll.

IVirtualScrollLayout ItemsLayout { get; set; }

Property Value

IVirtualScrollLayout

RefreshAccentColor

Gets or sets the accent color for the refresh indicator.

Color? RefreshAccentColor { get; set; }

Property Value

Color

RefreshCommand

Gets or sets the command to execute when the user requests a refresh.

ICommand? RefreshCommand { get; set; }

Property Value

ICommand

SectionFooterTemplate

Gets or sets the template used to display section footers.

DataTemplate? SectionFooterTemplate { get; set; }

Property Value

DataTemplate

SectionHeaderTemplate

Gets or sets the template used to display section headers.

DataTemplate? SectionHeaderTemplate { get; set; }

Property Value

DataTemplate

Methods

GetGlobalFooterTemplate()

Gets the appropriate global footer template.

DataTemplate? GetGlobalFooterTemplate()

Returns

DataTemplate

GetGlobalHeaderTemplate()

Gets the appropriate global header template.

DataTemplate? GetGlobalHeaderTemplate()

Returns

DataTemplate

GetItemTemplate(object?)

Gets the appropriate item template for the given item.

DataTemplate? GetItemTemplate(object? item)

Parameters

item object

Returns

DataTemplate

GetSectionFooterTemplate(object?)

Gets the appropriate section footer template for the given section.

DataTemplate? GetSectionFooterTemplate(object? section)

Parameters

section object

Returns

DataTemplate

GetSectionHeaderTemplate(object?)

Gets the appropriate section header template for the given section.

DataTemplate? GetSectionHeaderTemplate(object? section)

Parameters

section object

Returns

DataTemplate

ScrollTo(int, int, ScrollToPosition, bool)

Scrolls to the specified item in the virtual scroll.

void ScrollTo(int sectionIndex, int itemIndex, ScrollToPosition position = ScrollToPosition.MakeVisible, bool animated = true)

Parameters

sectionIndex int

The index of the section.

itemIndex int

The index of the item within the section. Use -1 to scroll to the section header.

position ScrollToPosition

The position to scroll to. Defaults to MakeVisible.

animated bool

Whether the scroll should be animated. Defaults to true.

ScrollTo(object, ScrollToPosition, bool)

Scrolls to the specified item or section in the virtual scroll. This method searches through all sections and items to find the matching object.

void ScrollTo(object itemOrSection, ScrollToPosition position = ScrollToPosition.MakeVisible, bool animated = true)

Parameters

itemOrSection object

The item or section object to scroll to.

position ScrollToPosition

The position to scroll to. Defaults to MakeVisible.

animated bool

Whether the scroll should be animated. Defaults to true.

Events

OnScrolled

Event raised when the scroll position changes.

event EventHandler<VirtualScrollScrolledEventArgs> OnScrolled

Event Type

EventHandler<VirtualScrollScrolledEventArgs>