Table of Contents

Method GetSelectedItems

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GetSelectedItems<T>(Action, Func<int>, Func<int, T>)

Retrieves a list of selected items by executing the specified update action and item retrieval functions.

public static IReadOnlyList<T> GetSelectedItems<T>(Action update, Func<int> getCount, Func<int, T> getItem)

Parameters

update Action

An action that updates the selection state before retrieving items.

getCount Func<int>

A function that returns the total number of items available for selection.

getItem Func<int, T>

A function that retrieves an item by its index.

Returns

IReadOnlyList<T>

A read-only list of selected items of type T. The list will be empty if no items are selected.

Type Parameters

T

The type of items to retrieve.

Remarks

The update action is called to ensure the selection state is current before items are retrieved. The getItem function is expected to return a non-null item for each valid index.