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);
        }
Пример #3
0
        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;
        }
Пример #4
0
        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;
        }
Пример #5
0
 public void AddContentProperty(ContentPropertyDefinition item)
 {
     ContentPropertyProvider.Add(item);
 }
Пример #6
0
 public string GetContentPropertyName(Type type)
 {
     return(ContentPropertyProvider.GetContentPropertyName(type));
 }
Пример #7
0
 public TypeFeatureProviderBuilder FromAttributes(IEnumerable <Type> types)
 {
     contentPropertyProvider = ContentPropertyProvider.FromAttributes(types);
     converterProvider       = TypeConverterProvider.FromAttributes(types);
     return(this);
 }