GridLength 结构

定义

用于定义网格 ColumnDefinition 和 RowDefinition 的大小(宽度/高度)。

public value class GridLength
public readonly struct GridLength
[System.ComponentModel.TypeConverter(typeof(Microsoft.Maui.GridLength+GridLengthTypeConverter))]
public readonly struct GridLength
type GridLength = struct
[<System.ComponentModel.TypeConverter(typeof(Microsoft.Maui.GridLength+GridLengthTypeConverter))>]
type GridLength = struct
Public Structure GridLength
继承
GridLength
属性

注解

GridUnitType.Absolute 类型的 GridLength 表示确切的大小。 GridUnitType.Auto 类型的类型调整以适应网格列/行中元素的大小。 GridUnitType.Star 类型的 GridLength 用于拆分成比例存储桶中的可用大小。

此值类型是只读的。

构造函数

GridLength(Double)

初始化新的 Absolute GridLength。

GridLength(Double, GridUnitType)

初始化新的 GridLength。

字段

Auto

可供重用的 GridUnitType.Auto 的 GridLength。

Star

可供重用的 GridUnitType.Star 的 GridLength,值为 1。

属性

GridUnitType

获取或设置 GridLength 的 GridUnitType

IsAbsolute

获取 GridLength 的 GridUnitType 是否为 GridUnitType.Absolute。

IsAuto

获取 GridLength 的 GridUnitType 是否为 GridUnitType.Auto。

IsStar

获取指示 GridLength 的 GridUnitType 是否为 GridUnitType.Star 的值。

Value

获取 GridLength 的值。

方法

Equals(Object)

测试此 GridLength 与另一个 GridLength 是否相等。

GetHashCode()

返回用于在集合中高效存储此对象的值。

ToString()

返回值和网格单元类型,以“.”号分隔。

运算符

Equality(GridLength, GridLength)

用于定义网格 ColumnDefinition 和 RowDefinition 的大小(宽度/高度)。

Implicit(Double to GridLength)

用于定义网格 ColumnDefinition 和 RowDefinition 的大小(宽度/高度)。

Inequality(GridLength, GridLength)

用于定义网格 ColumnDefinition 和 RowDefinition 的大小(宽度/高度)。

适用于