public CleanWiringContextBuilder() { var xamlNamespaceRegistry = new XamlNamespaceRegistry(); TypeContext = new TypeContext(new XamlTypeRepository(xamlNamespaceRegistry), xamlNamespaceRegistry, new TypeFactory()); ContentPropertyProvider = new ContentPropertyProvider(); TypeConverterProvider = new TypeConverterProvider(); }
public static IContentPropertyProvider FromAttributes(IEnumerable <Type> types) { var contentPropertyProvider = new ContentPropertyProvider(); var defs = Extensions.GatherAttributes <ContentPropertyAttribute, ContentPropertyDefinition>( types, (type, attribute) => new ContentPropertyDefinition(type, attribute.Name)); contentPropertyProvider.AddAll(defs); return(contentPropertyProvider); }
public static IContentPropertyProvider FromAttributes(IEnumerable<Type> types) { var contentPropertyProvider = new ContentPropertyProvider(); var defs = Extensions.GatherAttributes<ContentPropertyAttribute, ContentPropertyDefinition>( types, (type, attribute) => new ContentPropertyDefinition(type, attribute.Name)); contentPropertyProvider.AddAll(defs); return contentPropertyProvider; }
private static ContentPropertyProvider GetContentPropertyProvider() { var contentPropertyProvider = new ContentPropertyProvider(); var contentProperties = new Collection<ContentPropertyDefinition> { new ContentPropertyDefinition(typeof(ContentControl), "Content"), new ContentPropertyDefinition(typeof(Decorator), "Child"), new ContentPropertyDefinition(typeof(ItemsControl), "Items"), new ContentPropertyDefinition(typeof(GradientBrush), "GradientStops"), new ContentPropertyDefinition(typeof(Panel), "Children"), new ContentPropertyDefinition(typeof(Style), "Setters"), new ContentPropertyDefinition(typeof(TextBlock), "Text"), new ContentPropertyDefinition(typeof(TextBox), "Text"), new ContentPropertyDefinition(typeof(XamlDataTemplate), "Content"), }; contentPropertyProvider.AddAll(contentProperties); return contentPropertyProvider; }
public void AddContentProperty(ContentPropertyDefinition item) { ContentPropertyProvider.Add(item); }
public string GetContentPropertyName(Type type) { return(ContentPropertyProvider.GetContentPropertyName(type)); }
public TypeFeatureProviderBuilder FromAttributes(IEnumerable <Type> types) { contentPropertyProvider = ContentPropertyProvider.FromAttributes(types); converterProvider = TypeConverterProvider.FromAttributes(types); return(this); }