Share via


GridLengthHelper.FromValueAndType(Double, GridUnitType) 方法

定义

基于可能的像素数创建新的 GridLength 值和 GridUnitType。 C# 和 Microsoft Visual Basic 代码应改用 GridLength (Double,GridUnitType) 构造函数。

public:
 static GridLength FromValueAndType(double value, GridUnitType type);
 static GridLength FromValueAndType(double const& value, GridUnitType const& type);
public static GridLength FromValueAndType(double value, GridUnitType type);
function fromValueAndType(value, type)
Public Shared Function FromValueAndType (value As Double, type As GridUnitType) As GridLength

参数

value
Double

double

数字值。 如果类型指定为像素,则这可能是要指定的像素高度或宽度;如果类型指定为星形,则为因子。 如果将 类型 指定为 Auto,则忽略此值。

type
GridUnitType

枚举的一个值,该值指定 GridLength 表示的单元类型。

返回

创建的 GridLength

适用于