Hi all
I wonder if anyone else ran into this problem.
I'm using TypeConverters and I noticed when I set the linker to Link all assemblies
, TypeDescriptor.GetConverter
fails to return the typeconverter I specified with an attribute.
Here is the code i tried
[TypeConverter(typeof(TestEnumTypeConverter))]
public enum TestEnum
{
One,Two
}
public class TestEnumTypeConverter:TypeConverter
{
public override object ConvertTo (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
return "hello";
}
}
Then in your ViewDidLoad
, call the following
var tc = TypeDescriptor.GetConverter(typeof(TestEnum));
Console.WriteLine(tc.GetType().ToString());
With the default linker option, I get the correct TypeConverter. With the Link all option, I always get System.ComponentModel.EnumConverter
I'll see if I can use the default linker option as a workaround for now. Is this a known issue?
I'm using Xamarin iOS v6.2.7.1
- edit: Adding
[Preserve]
to theTestEnumTypeConverter
didn't help either