WPF TypeConverter ConvertTo not firing
- by JFoulkes
Hi,
I have a dependency property in a class which I need to be converted to a string.
I have added the TypeConverty attribute on the property. The type I am converting is the .net Style class.
[TypeConverter(typeof(BulletStyleTypeConverter))]
public Style BulletStyle
{
get { return (Style)GetValue(BulletStyleProperty); }
set { this.SetValue(BulletStyleProperty, value); }
}
When I put the string "Rectangle" in for BulletStyle in xaml it hits the ConvertFrom method in my converter.
However, when I use XamlWriter.Save() to serialise this, the property does not appear as an attribute in the string which is produced.
I have implemented ConvertTo and put a breakpoint on, which is never hit.
I have implemented CanConvertTo and put a breakpoint on, which IS hit and returns true. So i'm stumped as to why ConvertTo never fires.