public AvaloniaRuntimeTypeSource(ITypeFactory typeFactory)
        {
            var namespaceRegistry = new AvaloniaNamespaceRegistry();
            var featureProvider = new AvaloniaTypeFeatureProvider();
            var typeRepository = new AvaloniaTypeRepository(namespaceRegistry, typeFactory, featureProvider);

            inner = new RuntimeTypeSource(typeRepository, namespaceRegistry);
        }
        public AvaloniaRuntimeTypeSource(ITypeFactory typeFactory)
        {
            var namespaceRegistry = new AvaloniaNamespaceRegistry();
            var featureProvider   = new AvaloniaTypeFeatureProvider();
            var typeRepository    = new AvaloniaTypeRepository(namespaceRegistry, typeFactory, featureProvider);

            inner = new RuntimeTypeSource(typeRepository, namespaceRegistry);
        }
        private static ITypeContext CreateTypeContext(ITypeFactory typeFactory, TypeFeatureProvider featureProvider)
        {
            var xamlNamespaceRegistry = CreateXamlNamespaceRegistry();
            var typeRepository = new AvaloniaTypeRepository(xamlNamespaceRegistry, typeFactory, featureProvider);

            typeRepository.RegisterMetadata(new GenericMetadata<Visual>().WithRuntimeNameProperty(d => d.Name));
            typeRepository.RegisterMetadata(new GenericMetadata<Setter>().WithMemberDependency(x => x.Value, x => x.Property));
            typeRepository.RegisterMetadata(
                new GenericMetadata<SelectingItemsControl>()
                .WithMemberDependency(x => x.SelectedIndex, x => x.Items)
                .WithMemberDependency(x => x.SelectedItem, x => x.Items));

            return new TypeContext(typeRepository, xamlNamespaceRegistry, typeFactory);
        }
Beispiel #4
0
        private static ITypeContext CreateTypeContext(ITypeFactory typeFactory, TypeFeatureProvider featureProvider)
        {
            var xamlNamespaceRegistry = CreateXamlNamespaceRegistry();
            var typeRepository        = new AvaloniaTypeRepository(xamlNamespaceRegistry, typeFactory, featureProvider);

            typeRepository.RegisterMetadata(new GenericMetadata <Visual>().WithRuntimeNameProperty(d => d.Name));
            typeRepository.RegisterMetadata(new GenericMetadata <Setter>().WithMemberDependency(x => x.Value, x => x.Property));
            typeRepository.RegisterMetadata(
                new GenericMetadata <SelectingItemsControl>()
                .WithMemberDependency(x => x.SelectedIndex, x => x.Items)
                .WithMemberDependency(x => x.SelectedItem, x => x.Items));

            return(new TypeContext(typeRepository, xamlNamespaceRegistry, typeFactory));
        }