private void RegisterContentProperties(WiringContextBuilder wiringContextBuilder) { foreach (var contentPropertyDefinition in ContentPropertyDefinitions) { wiringContextBuilder.WithContentProperty(contentPropertyDefinition); } }
public XamlXmlLoader Build() { var wiringContextBuilder = new WiringContextBuilder(); wiringContextBuilder .WithContentPropertiesFromAssemblies(lookupAssemblies) .WithNsPrefixes(prefixes) .WithConverters(Converters.FromAssemblies(lookupAssemblies)); RegisterNamespaces(wiringContextBuilder); RegisterContentProperties(wiringContextBuilder); var wiringContext = wiringContextBuilder.Build(); var assembler = new ObjectAssembler(wiringContext); return new XamlXmlLoader(assembler, wiringContext); }
public static WiringContext Create(ITypeFactory typeFactory) { var rootType = typeof (DummyClass); var anotherType = typeof (Foreigner); var builder = new WiringContextBuilder(); var definitionForRoot = XamlNamespace .Map("root") .With( new[] { Route.Assembly(rootType.Assembly) .WithNamespaces( new[] { rootType.Namespace, typeof (Window).Namespace, }) }); var definitionForAnother = XamlNamespace .Map("another") .With( new[] { Route.Assembly(anotherType.Assembly) .WithNamespaces(new[] {anotherType.Namespace}) }); var contentProperties = ContentProperties.DefinedInAssemblies(new[] {rootType.Assembly}); builder.WithNamespaces(new List<XamlNamespace> {definitionForRoot, definitionForAnother}) .WithContentProperties(contentProperties) .WithNsPrefixes( new List<PrefixRegistration> { new PrefixRegistration(string.Empty, "root"), new PrefixRegistration("x", "another"), }); builder.WithTypeFactory(typeFactory); return builder.Build(); }
private void RegisterNamespaces(WiringContextBuilder wiringContextBuilder) { wiringContextBuilder.WithNamespaces(NamespaceRegistrations); }