2 using System.ComponentModel;
3 using Microsoft.Windows.Design;
4 using Tizen.NUI.BaseComponents;
5 using Tizen.NUI.XamlBinding;
7 namespace Tizen.NUI.Design
9 internal class AttributeTableBuilder : Microsoft.Windows.Design.Metadata.AttributeTableBuilder
11 [EditorBrowsable(EditorBrowsableState.Never)]
12 public AttributeTableBuilder()
14 // Turn off validation of values, which doesn't work for OnPlatform/OnIdiom
15 AddCustomAttributes(typeof(View).Assembly,
16 new XmlnsSupportsValidationAttribute("http://tizen.org/Tizen.NUI/2018/XAML", false));
18 // Style isn't a view, make it visible
19 AddCallback(typeof(Style), builder => builder.AddCustomAttributes(
20 new EditorBrowsableAttribute(EditorBrowsableState.Always),
21 new global::System.Windows.Markup.ContentPropertyAttribute("Setters"),
22 // Since the class doesn't have a public parameterless ctor, we need to provide a converter
23 new global::System.ComponentModel.TypeConverterAttribute(typeof(StringConverter))));
25 // The Setter.Value can actually come from an <OnPlatform />, so enable it as Content.
26 AddCallback(typeof(Setter), builder => builder.AddCustomAttributes(
27 new EditorBrowsableAttribute(EditorBrowsableState.Always),
28 new global::System.Windows.Markup.ContentPropertyAttribute("Value")));
30 // Special case for FontSize which isn't an enum.
31 //var fontElements = typeof(View).Assembly.ExportedTypes.Where(t => typeof(IFontElement).IsAssignableFrom(t));
32 //foreach (var fontElement in fontElements)
34 // AddCallback(fontElement, builder => builder.AddCustomAttributes(
36 // new global::System.ComponentModel.TypeConverterAttribute(typeof(NonExclusiveEnumConverter<NamedSize>))));
41 internal class AnythingConverter : global::System.ComponentModel.TypeConverter
43 [EditorBrowsable(EditorBrowsableState.Never)]
44 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
49 [EditorBrowsable(EditorBrowsableState.Never)]
50 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
55 [EditorBrowsable(EditorBrowsableState.Never)]
56 public override bool IsValid(ITypeDescriptorContext context, object value)