See Also: TypeConverterAttribute
public sealed class TypeConverterAttribute : Attribute
The class you use for conversion must inherit from TypeConverter. Use the TypeConverterAttribute.ConverterTypeName property to get the name of the class that provides the data conversion for the object this attribute is bound to.
In order to establish a type converter on a custom class that provides type conversion behavior for XAML, you apply the TypeConverterAttribute attribute to your type. The argument of the attribute references your type converter implementation. Your type converter should be able to accept values from a string that is used for attributes or initialization text in XAML markup, and convert that string into your intended destination type. For more information, see TypeConverters and XAML.
Rather than applying to all values of a type, a type converter behavior for XAML can also be established on a specific property. In this case, you apply TypeConverterAttribute to the property definition (the outer definition, not the specific get and set definitions).
A type converter behavior for XAML usage of a custom attachable member can be assigned by applying TypeConverterAttribute to the get method accessor that supports the XAML usage. For more information, see Attached Properties Overview.
For complex XAML serialization cases that require additional state from the object runtime, consider defining a value serializer in addition to a type converter, and attribute both support classes on your custom types or custom members. For more information, see ValueSerializer.
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 188.8.131.52, 184.108.40.206
The members of System.ComponentModel.TypeConverterAttribute are listed below.
See Also: Attribute
Initializes a new instance of the TypeConverterAttribute class with the default type converter, which is an empty string ("").
Initializes a new instance of the TypeConverterAttribute class, using the specified type name as the data converter for the object this attribute is bound to.
Initializes a new instance of the TypeConverterAttribute class, using the specified type as the data converter for the object this attribute is bound to.