ClassSizeTypeConverter
Provides a type converter to convert between Size and string representations. This converter uses a internally to parse string values into Point objects, which are then converted to Size objects.
Definition
Namespace:Telerik.Maui
Assembly:Telerik.Maui.Core.dll
Syntax:
public class SizeTypeConverter : TypeConverter
Inheritance: objectTypeConverterSizeTypeConverter
Inherited Members
Constructors
SizeTypeConverter()
Initializes a new instance of the SizeTypeConverter class. Creates the internal if it doesn't exist.
Declaration
public SizeTypeConverter()
Methods
CanConvertFrom(ITypeDescriptorContext, Type)
Returns whether this converter can convert an object of the given type to a Size.
Declaration
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Parameters
context
An ITypeDescriptorContext that provides a format context.
sourceType
A Type that represents the type you want to convert from.
Returns
true
if this converter can perform the conversion and sourceType
is string; otherwise, false
.
Overrides
CanConvertTo(ITypeDescriptorContext, Type)
Returns whether this converter can convert a Size to an object of the given type.
Declaration
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
Parameters
context
An ITypeDescriptorContext that provides a format context.
destinationType
A Type that represents the type you want to convert to.
Returns
true
if this converter can perform the conversion and destinationType
is string; otherwise, false
.
Overrides
ConvertFrom(ITypeDescriptorContext, CultureInfo, object)
Converts the given string value to a Size object.
Declaration
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Parameters
context
An ITypeDescriptorContext that provides a format context.
culture
The CultureInfo to use as the current culture.
value
Returns
A Size object converted from the string representation.
Exceptions
Thrown when the value cannot be cast to a string or parsed as a point.
Overrides
ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)
Converts the given Size value to a string representation.
Declaration
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Parameters
context
An ITypeDescriptorContext that provides a format context.
culture
A CultureInfo to use for formatting.
value
The object to convert, expected to be a Size.
destinationType
The Type to convert the value parameter to.
Returns
A string representation of the Size value.
Overrides