We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Platform : WPF
|
Category : XML Namespaces

How can I apply the TypeConverter Attribute ?

In order for your custom type converter to be used as the acting type converter for a custom class, you must apply the .NET Framework “TypeConverter” attribute to your class definition. The Converter Type ’Name’ that you specify through the attribute must be the type name of your custom type converter. With this attribute applied, when an XAML processor handles values where the property type uses your custom class type, it can input strings and return object instances. You can also provide a type converter on a per-property basis. Instead of applying a .NET Framework “TypeConverter” attribute to the class definition, apply it to a property definition (the main definition, not the get / set implementations within it). The type of the property must match the type that is processed by your custom type converter. With this attribute applied, when an XAML processor handles values of that property, it can process input strings and return object instances. The per-property type converter technique is particularly useful if you choose to use a property type from Microsoft .NET Framework or from some other library where you cannot control the class definition and cannot apply a “TypeConverter” attribute there.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon