GridLength 建構函式

定義

多載

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.

備註

這個結構代表 Windows 執行階段 (WinRT) GridLength結構的 .net 投射。This struct represents the .NET projection of the Windows Runtime (WinRT) GridLength struct. 如需詳細資訊, 請參閱 UWP API 參考中的GridLengthFor more information, see GridLength in the UWP API reference.

GridLength(Double)

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

public:
 GridLength(double pixels);
public GridLength (double pixels);
new Windows.UI.Xaml.GridLength : double -> Windows.UI.Xaml.GridLength
Public Sub New (pixels As Double)

參數

pixels
Double

要以值建立的絕對像素計數。The absolute count of pixels to establish as the value.

GridLength(Double, GridUnitType)

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

public:
 GridLength(double value, Windows::UI::Xaml::GridUnitType type);
public GridLength (double value, Windows.UI.Xaml.GridUnitType type);
new Windows.UI.Xaml.GridLength : double * Windows.UI.Xaml.GridUnitType -> Windows.UI.Xaml.GridLength
Public Sub New (value As Double, type As GridUnitType)

參數

value
Double

這個 GridLength 執行個體的初始值。The initial value of this instance of GridLength.

type
GridUnitType

這個 GridUnitType 執行個體包含的 GridLengthThe GridUnitType held by this instance of GridLength.

例外狀況

value 小於 0 或不是數字。value is less than 0 or is not a number.

-或--or-

type 不是有效的 GridUnitTypetype is not a valid GridUnitType.

適用於