SizeTypeConverter
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
Initializes a new instance of the SizeTypeConverter class. Creates the internal if it doesn't exist.
public SizeTypeConverter()
Methods
Returns whether this converter can convert an object of the given type to a Size.
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
An ITypeDescriptorContext that provides a format context.
sourceTypeTypeA 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:
Returns whether this converter can convert a Size to an object of the given type.
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
An ITypeDescriptorContext that provides a format context.
destinationTypeTypeA 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:
Converts the given string value to a Size object.
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
An ITypeDescriptorContext that provides a format context.
cultureCultureInfoThe CultureInfo to use as the current culture.
valueobjectReturns:A Size object converted from the string representation.
Exceptions: InvalidCastExceptionThrown when the value cannot be cast to a string or parsed as a point.
Overrides:
Converts the given Size value to a string representation.
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
An ITypeDescriptorContext that provides a format context.
cultureCultureInfoA CultureInfo to use for formatting.
valueobjectThe object to convert, expected to be a Size.
destinationTypeTypeThe Type to convert the value parameter to.
Returns:A string representation of the Size value.
Overrides: