GridLengthConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) 方法

定义

尝试将 GridLength 的实例转换为指定类型。Attempts to convert an instance of GridLength to a specified type.

public:
 override System::Object ^ ConvertTo(System::ComponentModel::ITypeDescriptorContext ^ typeDescriptorContext, System::Globalization::CultureInfo ^ cultureInfo, System::Object ^ value, Type ^ destinationType);
public override object ConvertTo (System.ComponentModel.ITypeDescriptorContext typeDescriptorContext, System.Globalization.CultureInfo cultureInfo, object value, Type destinationType);
[System.Security.SecurityCritical]
public override object ConvertTo (System.ComponentModel.ITypeDescriptorContext typeDescriptorContext, System.Globalization.CultureInfo cultureInfo, object value, Type destinationType);
override this.ConvertTo : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj * Type -> obj
Public Overrides Function ConvertTo (typeDescriptorContext As ITypeDescriptorContext, cultureInfo As CultureInfo, value As Object, destinationType As Type) As Object

参数

typeDescriptorContext
ITypeDescriptorContext

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

cultureInfo
CultureInfo

转换过程中应考虑的区域性特定信息。Cultural specific information that should be respected during conversion.

value
Object

要转换的 GridLength 实例。The instance of GridLength to convert.

destinationType
Type

GridLength 实例被转换成的类型。The type that this instance of GridLength is converted to.

返回

GridLength 的已转换实例创建的对象。The object that is created from the converted instance of GridLength.

属性

例外

destinationType 不是转换的有效类型之一。destinationType is not one of the valid types for conversion.

valuenullvalue is null.

注解

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

适用于

另请参阅