IColumns Interface
Definition
Represents a collection of columns in an Avalonia.Controls.ITreeDataGridSource.
public interface IColumns
Remarks
Note that items retrieved from an Avalonia.Controls.Models.TreeDataGrid.IColumns collection may be reused, so the Avalonia.Controls.Models.TreeDataGrid.IColumn should be treated as valid only until the next item is retrieved from the collection.
Methods
| Name | Description |
|---|---|
| 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. |
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