Method GetSelectedItems
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
updateActionAn action that updates the selection state before retrieving items.
getCountFunc<int>A function that returns the total number of items available for selection.
getItemFunc<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
TThe 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.