GridLengthConverter.CanConvertFrom(ITypeDescriptorContext, Type) 方法

定义

确定是否可将一个类从特定类型转换成 GridLength 实例。Determines whether a class can be converted from a given type to an instance of GridLength.

public:
 override bool CanConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ typeDescriptorContext, Type ^ sourceType);
public override bool CanConvertFrom (System.ComponentModel.ITypeDescriptorContext typeDescriptorContext, Type sourceType);
override this.CanConvertFrom : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overrides Function CanConvertFrom (typeDescriptorContext As ITypeDescriptorContext, sourceType As Type) As Boolean

参数

typeDescriptorContext
ITypeDescriptorContext

描述类型的上下文信息。Describes the context information of a type.

sourceType
Type

正被计算用于转换的源类型。The type of the source that is being evaluated for conversion.

返回

如果转换器可从指定类型转换成 GridLength 的实例,则为 true;否则为 falsetrue if the converter can convert from the specified type to an instance of GridLength; otherwise, false.

注解

GridLengthConverter 支持与以下类型的转换: StringDecimalSingleDoubleInt16Int32Int64UInt16UInt32UInt64GridLengthConverter supports conversion to and from the following types: String, Decimal, Single, Double, Int16, Int32, Int64, UInt16, UInt32, UInt64.

适用于

另请参阅