GridLength 结构

定义

表示显式支持 Star 单位类型的元素长度。Represents the length of elements that explicitly support Star unit types.

public value class GridLength : IEquatable<System::Windows::GridLength>
[System.ComponentModel.TypeConverter(typeof(System.Windows.GridLengthConverter))]
public struct GridLength : IEquatable<System.Windows.GridLength>
type GridLength = struct
Public Structure GridLength
Implements IEquatable(Of GridLength)
继承
GridLength
属性
实现

注解

ColumnDefinitionRowDefinition 等元素使用此类型来描述宽度和高度,以便支持可用空间的变量分布。Elements such as ColumnDefinition and RowDefinition use this type to describe width and height in order to support variable distribution of available space.

XAML 属性用法XAML Attribute Usage

<object property="doubleLength"/>  

-or-

<object property="autoValue"/>  

XAML 值XAML Values

doubleLengthdoubleLength
元素的长度,描述为指定 与设备无关的单位(每个单位 1/96 英寸)device-independent units (1/96th inch per unit) 度量值或qualifiedDoubleDouble 值(见下文)。The element's length, described as either a Double value that specifies a 与设备无关的单位(每个单位 1/96 英寸)device-independent units (1/96th inch per unit) measure, or as a qualifiedDouble (see below).

autoValueautoValue
元素的长度,由值 Auto 或 * 描述。The element's length, described by either the value Auto or *. 有关 Auto 和 * 值的详细信息,请参阅 GridUnitTypeSee GridUnitType for more information on the values Auto and *.

qualifiedDoublequalifiedDouble
上述任何度量值的双精度值,后跟以下单元声明字符串之一: pxincm``ptA double value as described above for any of the measures, followed by one of the following unit declaration strings: px, in, cm, pt.

px (默认值)为 与设备无关的单位(每个单位 1/96 英寸)device-independent units (1/96th inch per unit)px (default) is 与设备无关的单位(每个单位 1/96 英寸)device-independent units (1/96th inch per unit)

in 为英寸;1in = = 96pxin is inches; 1in==96px

cm 是厘米;1cm = = (96/2.54) pxcm is centimeters; 1cm==(96/2.54) px

pt 为点;1pt = = (96/72) pxpt is points; 1pt==(96/72) px

构造函数

GridLength(Double)

使用指定的绝对值(以像素为单位)初始化 GridLength 结构的新实例。Initializes a new instance of the GridLength structure using the specified absolute value in pixels.

GridLength(Double, GridUnitType)

初始化 GridLength 结构的新实例并指定它包含何种类型的值。Initializes a new instance of the GridLength structure and specifies what kind of value it holds.

属性

Auto

获取一个 GridLength 实例,它包含大小由内容对象的大小属性确定的值。Gets an instance of GridLength that holds a value whose size is determined by the size properties of the content object.

GridUnitType

获取 GridUnitType 的关联 GridLengthGets the associated GridUnitType for the GridLength.

IsAbsolute

获取一个值,该值指示 GridLength 是否包含以像素表示的值。Gets a value that indicates whether the GridLength holds a value that is expressed in pixels.

IsAuto

获取一个值,该值指示 GridLength 是否包含大小由内容对象的大小属性确定的值。Gets a value that indicates whether the GridLength holds a value whose size is determined by the size properties of the content object.

IsStar

获取一个值,该值指示 GridLength 是否包含以可用空间的加权比例表示的值。Gets a value that indicates whether the GridLength holds a value that is expressed as a weighted proportion of available space.

Value

获取一个 Double,它表示 GridLength 的值。Gets a Double that represents the value of the GridLength.

方法

Equals(GridLength)

确定指定的 GridLength 是否等同于当前的 GridLengthDetermines whether the specified GridLength is equal to the current GridLength.

Equals(Object)

确定指定对象是否与当前的 GridLength 实例相等。Determines whether the specified object is equal to the current GridLength instance.

GetHashCode()

获取 GridLength 的哈希代码。Gets a hash code for the GridLength.

ToString()

返回 StringGridLength 表示形式。Returns a String representation of the GridLength.

运算符

Equality(GridLength, GridLength)

比较两个 GridLength 结构是否相等。Compares two GridLength structures for equality.

Inequality(GridLength, GridLength)

对两个 GridLength 结构进行比较,确定它们是否不相等。Compares two GridLength structures to determine if they are not equal.

适用于

另请参阅