ColumnList<TModel> Class
Definition
An implementation of Avalonia.Controls.Models.TreeDataGrid.IColumns that stores its columns in a list.
public class ColumnList<TModel>
Constructors
| Name | Description |
|---|---|
| ColumnList<TModel> | No summary available. |
ColumnList<TModel> Constructor
public ColumnList<TModel>()
Methods
| Name | Description |
|---|---|
| AddRange | No summary available. |
| CellMeasured | Called by the Avalonia.Controls.Models.TreeDataGrid when a cell has been measured. |
| CommitActualWidths | Commits the actual widths of the columns. |
| GetColumnAt | Gets the index and X position of the column at the specified X position, if it can be calculated. |
| GetEstimatedWidth | Gets the estimated total width of all columns. |
| GetFrozenColumnsWidth | Gets the total width of frozen columns. |
| SetColumnWidth | Sets the width of a column. |
| ViewportChanged | Called 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
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
| Name | Description |
|---|---|
| LayoutInvalidated | Occurs when the layout of columns is invalidated. |
LayoutInvalidated Event
Occurs when the layout of columns is invalidated.
public event EventHandler LayoutInvalidated