Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GridLengthConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)


Attempts to convert a specified object to an instance of GridLength.

Namespace:   System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)

public override object ConvertFrom(
	ITypeDescriptorContext typeDescriptorContext,
	CultureInfo cultureInfo,
	object source


Type: System.ComponentModel.ITypeDescriptorContext

Describes the context information of a type.

Type: System.Globalization.CultureInfo

Cultural specific information that should be respected during conversion.

Type: System.Object

The object being converted.

Return Value

Type: System.Object

The instance of GridLength that is created from the converted source.

Exception Condition

source object is null.


source object is not null and is not a valid type that can be converted to a GridLength.

GridLengthConverter supports conversion to and from the following types: String, Decimal, Single, Double, Int16, Int32, Int64, UInt16, UInt32, UInt64.

.NET Framework
Available since 3.0
Return to top
© 2016 Microsoft