Skip to main content

ColumnList<TModel> Class

Definition

Assembly:Avalonia.Controls.TreeDataGrid
Package:Avalonia.Controls.TreeDataGrid

An implementation of Avalonia.Controls.Models.TreeDataGrid.IColumns that stores its columns in a list.

public class ColumnList<TModel>

Inheritance: NotifyingListBase<IColumn<>> -> ColumnList<TModel>

Implements: IColumns, IEnumerable<IColumn>, IReadOnlyCollection<IColumn>, IReadOnlyList<IColumn>, IEnumerable, INotifyCollectionChanged

Constructors

NameDescription
ColumnList<TModel>No summary available.

ColumnList<TModel> Constructor

public ColumnList<TModel>()

Methods

NameDescription
AddRangeNo summary available.
CellMeasuredCalled by the Avalonia.Controls.Models.TreeDataGrid when a cell has been measured.
CommitActualWidthsCommits the actual widths of the columns.
GetColumnAtGets the index and X position of the column at the specified X position, if it can be calculated.
GetEstimatedWidthGets the estimated total width of all columns.
GetFrozenColumnsWidthGets the total width of frozen columns.
SetColumnWidthSets the width of a column.
ViewportChangedCalled by the Avalonia.Controls.Models.TreeDataGrid when the viewport changes.

AddRange Method

public void AddRange(System.Collections.Generic.IEnumerable<Avalonia.Controls.Models.TreeDataGrid.IColumn<TModel><TModel>> items)

Parameters

items System.Collections.Generic.IEnumerable<Avalonia.Controls.Models.TreeDataGrid.IColumn<TModel><TModel>>

CellMeasured Method

Called by the Avalonia.Controls.Models.TreeDataGrid when a cell has been measured.

public Avalonia.Size CellMeasured(int columnIndex, int rowIndex, Avalonia.Size size)

Parameters

columnIndex int

The cell column index or -1 for a row header.

rowIndex int

The cell row index or -1 for a column header.

size Avalonia.Size

The measured size.

Returns

Avalonia.Size

The desired size of the cell after column sizing has been applied.

CommitActualWidths Method

Commits the actual widths of the columns.

public void CommitActualWidths()

GetColumnAt Method

Gets the index and X position of the column at the specified X position, if it can be calculated.

public ValueTuple<int, double> GetColumnAt(double x)

Parameters

x double

The X position

Returns

ValueTuple<int, double>

A tuple containing the column index and X position of the column, or (-1,-1) if the column could not be calculated.

GetEstimatedWidth Method

Gets the estimated total width of all columns.

public double GetEstimatedWidth(double constraint)

Parameters

constraint double

The available viewport width.

Returns

double

GetFrozenColumnsWidth Method

Gets the total width of frozen columns.

public double GetFrozenColumnsWidth(int frozenColumnCount)

Parameters

frozenColumnCount int

The number of frozen columns.

Returns

double

The combined width of all frozen columns, or 0 if columns have not been measured yet.

SetColumnWidth Method

Sets the width of a column.

public void SetColumnWidth(int columnIndex, Avalonia.Controls.GridLength width)

Parameters

columnIndex int

The column index.

width Avalonia.Controls.GridLength

The column width

ViewportChanged Method

Called by the Avalonia.Controls.Models.TreeDataGrid when the viewport changes.

public void ViewportChanged(Avalonia.Rect viewport)

Parameters

viewport Avalonia.Rect

The current viewport.

Events

NameDescription
LayoutInvalidatedOccurs when the layout of columns is invalidated.

LayoutInvalidated Event

Occurs when the layout of columns is invalidated.

public event EventHandler LayoutInvalidated