GridLength GridLength GridLength GridLength Struct

定義

代表明確支援 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)
繼承
GridLengthGridLengthGridLengthGridLength
屬性
實作

備註

項目,例如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 Attribute UsageXAML Attribute Usage

<object property="doubleLength"/>  
- or -  
<object property="autoValue"/>  

XAML 值XAML Values

doubleLengthdoubleLength
項目的長度,為所述Double值,指定裝置獨立單位 (每單位 1/96 英吋)device-independent units (1/96th inch per unit)量值,或是qualifiedDouble (如下所示)。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
透過下列方式描述項目的長度值自動或 *。The element's length, described by either the value Auto or *. 請參閱GridUnitType如需有關值自動和 *。See GridUnitType for more information on the values Auto and *.

qualifiedDoublequalifiedDouble
A值,如上面所述的任何量值,後面接著一個的下列單位宣告字串: pxincmptA 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) 像素cm is centimeters; 1cm==(96/2.54) px

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

建構函式

GridLength(Double) GridLength(Double) GridLength(Double) GridLength(Double)

使用指定的絕對值 (以像素為單位),初始化 GridLength 結構的新執行個體。Initializes a new instance of the GridLength structure using the specified absolute value in pixels.

GridLength(Double, GridUnitType) GridLength(Double, GridUnitType) GridLength(Double, GridUnitType) GridLength(Double, GridUnitType)

初始化 GridLength 結構的新執行個體,並指定要包含何種值。Initializes a new instance of the GridLength structure and specifies what kind of value it holds.

屬性

Auto Auto Auto 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 GridUnitType GridUnitType

取得 GridUnitType 的相關 GridLengthGets the associated GridUnitType for the GridLength.

IsAbsolute IsAbsolute IsAbsolute IsAbsolute

取得值,這個值指出 GridLength 是否包含以像素表示的值。Gets a value that indicates whether the GridLength holds a value that is expressed in pixels.

IsAuto IsAuto IsAuto 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 IsStar IsStar IsStar

取得值,這個值表示 GridLength 是否包含以可用空間的加權比例表示的值。Gets a value that indicates whether the GridLength holds a value that is expressed as a weighted proportion of available space.

Value Value Value Value

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

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件和目前的 GridLength 執行個體是否相等。Determines whether the specified object is equal to the current GridLength instance.

Equals(GridLength) Equals(GridLength) Equals(GridLength) Equals(GridLength)

判斷指定的 GridLength 是否等於目前的 GridLengthDetermines whether the specified GridLength is equal to the current GridLength.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

取得 GridLength 的雜湊碼。Gets a hash code for the GridLength.

ToString() ToString() ToString() ToString()

傳回 StringGridLength 表示。Returns a String representation of the GridLength.

運算子

Equality(GridLength, GridLength) Equality(GridLength, GridLength) Equality(GridLength, GridLength) Equality(GridLength, GridLength)

比較兩個 GridLength 結構是否相等。Compares two GridLength structures for equality.

Inequality(GridLength, GridLength) Inequality(GridLength, GridLength) Inequality(GridLength, GridLength) Inequality(GridLength, GridLength)

比較兩個 GridLength 結構,判斷它們是否不相等。Compares two GridLength structures to determine if they are not equal.

適用於

另請參閱