Table of Contents

Class VirtualScrollNotifyCollectionChangedAdapter<TItemCollection>

Namespace
Nalu
Assembly
Nalu.Maui.VirtualScroll.dll

An adapter that wraps an observable collection for use with VirtualScroll.

public class VirtualScrollNotifyCollectionChangedAdapter<TItemCollection> : IVirtualScrollAdapter where TItemCollection : IList, INotifyCollectionChanged

Type Parameters

TItemCollection

The type of the observable collection.

Inheritance
VirtualScrollNotifyCollectionChangedAdapter<TItemCollection>
Implements
Derived
Inherited Members

Constructors

VirtualScrollNotifyCollectionChangedAdapter(TItemCollection)

Initializes a new instance of the VirtualScrollNotifyCollectionChangedAdapter<TItemCollection> class based on the specified observable collection.

public VirtualScrollNotifyCollectionChangedAdapter(TItemCollection collection)

Parameters

collection TItemCollection

Properties

Collection

The underlying observable collection.

protected TItemCollection Collection { get; }

Property Value

TItemCollection

Methods

GetItem(int, int)

Gets the item object for the specified section and item index.

public object? GetItem(int sectionIndex, int itemIndex)

Parameters

sectionIndex int
itemIndex int

Returns

object

GetItemCount(int)

Gets the item count for the specified section.

public int GetItemCount(int sectionIndex)

Parameters

sectionIndex int

Returns

int

GetSection(int)

Gets the section object for the specified section index.

public object? GetSection(int sectionIndex)

Parameters

sectionIndex int

Returns

object

GetSectionCount()

Gets the section count.

public int GetSectionCount()

Returns

int

ShouldIgnoreCollectionChanges()

Tells if the adapter should ignore collection changes, therefore not notifying subscribers.

protected virtual bool ShouldIgnoreCollectionChanges()

Returns

bool

Subscribe(Action<VirtualScrollChangeSet>)

Subscribes to change notifications.

public IDisposable Subscribe(Action<VirtualScrollChangeSet> changeCallback)

Parameters

changeCallback Action<VirtualScrollChangeSet>

The callback to invoke when changes occur.

Returns

IDisposable

A disposable that unsubscribes from change notifications when disposed.