UriTypeConverter.CanConvertFrom Method (ITypeDescriptorContext, Type)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Returns whether this converter can convert an object of the specified source type to an instance of the Uri type.
Assembly: System (in System.dll)
Parameters
- context
- Type: System.ComponentModel.ITypeDescriptorContext
An ITypeDescriptorContext that provides a format context.
- sourceType
- Type: System.Type
A Type that represents the type that you want to convert from.
Return Value
Type: System.BooleanA Boolean value that is true if the converter can convert the specified type to an instance of Uri; otherwise, false.
| Exception | Condition |
|---|---|
| ArgumentNullException | sourceType is null (Nothing in Visual Basic). |
The CanConvertFrom method determines if a Type can be converted to a Uri. The sourceType parameter must be String or a Uri type that can be assigned from sourceType , otherwise this method returns false.