IUpdateColumnLayout Interface
Definition
Internal low-level interface for layout interactions between Avalonia.Controls.Models.TreeDataGrid.IColumns and Avalonia.Controls.Models.TreeDataGrid.IColumn.
public interface IUpdateColumnLayout
Methods
| Name | Description |
|---|---|
| CalculateStarWidth | Requests a star-width column to calculate its Avalonia.Controls.Models.TreeDataGrid.IColumn.ActualWidth. |
| CellMeasured | Notifies the column that a cell has been measured. |
| CommitActualWidth | Requests a column to set its final Avalonia.Controls.Models.TreeDataGrid.IColumn.ActualWidth based on the size calculated via Avalonia.Controls.Models.TreeDataGrid.IUpdateColumnLayout.CellMeasured(double,int) and Avalonia.Controls.Models.TreeDataGrid.IUpdateColumnLayout.CalculateStarWidth(double,double). |
| SetWidth | Notifies the column of a change to its preferred width. |
CalculateStarWidth Method
Requests a star-width column to calculate its Avalonia.Controls.Models.TreeDataGrid.IColumn.ActualWidth.
public void CalculateStarWidth(double availableWidth, double totalStars)
Parameters
availableWidth double
The available width to be shared by star-width columns.
totalStars double
The sum of the star units of all columns.
Remarks
This method may be called multiple times during a layout pass; the width calculated by this method should not be comitted to Avalonia.Controls.Models.TreeDataGrid.IColumn.ActualWidth until Avalonia.Controls.Models.TreeDataGrid.IUpdateColumnLayout.CommitActualWidth is called. This method should update the value of the Avalonia.Controls.Models.TreeDataGrid.IUpdateColumnLayout.StarWidthWasConstrained property.
CellMeasured Method
Notifies the column that a cell has been measured.
public double CellMeasured(double width, int rowIndex)
Parameters
width double
The measured width, in pixels; as returned by the cell DesiredSize.
rowIndex int
The cell row index or -1 for a column header.
Returns
double
The width of the cell updated with the column width.
CommitActualWidth Method
Requests a column to set its final Avalonia.Controls.Models.TreeDataGrid.IColumn.ActualWidth based on the size calculated via Avalonia.Controls.Models.TreeDataGrid.IUpdateColumnLayout.CellMeasured(double,int) and Avalonia.Controls.Models.TreeDataGrid.IUpdateColumnLayout.CalculateStarWidth(double,double).
public bool CommitActualWidth()
Returns
bool
True if the column's actual width has changed; otherwise false.
SetWidth Method
Notifies the column of a change to its preferred width.
public void SetWidth(Avalonia.Controls.GridLength width)
Parameters
width Avalonia.Controls.GridLength
The width.
Properties
| Name | Description |
|---|---|
| MaxActualWidth | Gets the maximum actual width of the column. |
| MinActualWidth | Gets the minimum actual width of the column. |
| StarWidthWasConstrained | Gets a value indicating whether the column is a star-width column and its width was constrained by its min/max width in the last call to Avalonia.Controls.Models.TreeDataGrid.IUpdateColumnLayout.CalculateStarWidth(double,double). |
MaxActualWidth Property
Gets the maximum actual width of the column.
public double MaxActualWidth { get; set; }
Returns
The maximum width of the column in pixels, or double.PositiveInfinity if the column has no maximum width.
MinActualWidth Property
Gets the minimum actual width of the column.
public double MinActualWidth { get; set; }
Returns
The minimum width of the column in pixels.
StarWidthWasConstrained Property
Gets a value indicating whether the column is a star-width column and its width was constrained by its min/max width in the last call to Avalonia.Controls.Models.TreeDataGrid.IUpdateColumnLayout.CalculateStarWidth(double,double).
public bool StarWidthWasConstrained { get; set; }