Table of Contents

Class DataCollectionState<TItem>

Namespace
BlazOrbit.Components
Assembly
BlazOrbit.dll

Maintains the state for data collection components including pagination, filtering, sorting, and selection.

public sealed class DataCollectionState<TItem>

Type Parameters

TItem

The type of the items in the collection.

Inheritance
object
DataCollectionState<TItem>

Constructors

DataCollectionState()

public DataCollectionState()

Properties

CurrentPage

The current page number.

public int CurrentPage { get; set; }

Property Value

int

FilterText

The current filter text.

public string FilterText { get; set; }

Property Value

string

PageSize

The number of items displayed per page.

public int PageSize { get; set; }

Property Value

int

SelectedItems

The set of currently selected items.

public IReadOnlySet<TItem> SelectedItems { get; }

Property Value

IReadOnlySet<TItem>

SortColumn

The name of the column currently used for sorting.

public string? SortColumn { get; set; }

Property Value

string

SortDirection

The current sort direction.

public SortDirection SortDirection { get; set; }

Property Value

SortDirection

Methods

ClearSelection()

Clears all selected items.

public void ClearSelection()

IsSelected(TItem)

Determines whether the specified item is selected.

public bool IsSelected(TItem item)

Parameters

item TItem

The item to check.

Returns

bool

true if the item is selected; otherwise, false.

ResetPagination()

Resets the current page to the first page.

public void ResetPagination()

SelectAll(IEnumerable<TItem>)

Selects all items in the specified collection.

public void SelectAll(IEnumerable<TItem> items)

Parameters

items IEnumerable<TItem>

The items to select.

SelectItem(TItem, SelectionMode)

Toggles the selection state of the specified item.

public void SelectItem(TItem item, SelectionMode mode)

Parameters

item TItem

The item to toggle.

mode SelectionMode

The selection mode.

ToggleSort(string)

Toggles the sort direction for the specified column.

public void ToggleSort(string columnName)

Parameters

columnName string

The name of the column to sort.