Exemple #1
0
        protected override XamlValueConverter <System.ComponentModel.TypeConverter> LookupTypeConverter()
        {
            if (typeConverter != null)
            {
                return(typeConverter);
            }
            var typeConverterAttrib = UnderlyingType.GetCustomAttribute <Eto.TypeConverterAttribute>();

            if (typeConverterAttrib != null)
            {
                var converterType = Type.GetType(typeConverterAttrib.ConverterTypeName);
                if (converterType != null)
                {
                    typeConverter = new EtoValueConverter(converterType, this);
                }
            }
            if (typeof(MulticastDelegate).IsAssignableFrom(UnderlyingType))
            {
                var context = SchemaContext as EtoXamlSchemaContext;
                if (context.DesignMode)
                {
                    return(null);
                }
            }


            if (typeConverter == null)
            {
                // convert from Eto.TypeConverter to System.ComponentModel.TypeConverter
                typeConverter = base.LookupTypeConverter();
            }
            return(typeConverter);
        }