private AvaloniaXamlObjectWriter(
     XamlSchemaContext schemaContext,
     XamlObjectWriterSettings settings,
     AvaloniaNameScope nameScope,
     IAmbientProvider parentAmbientProvider)
     : base(schemaContext, settings, parentAmbientProvider)
 {
     _nameScope = nameScope;
 }
Esempio n. 2
0
 private AvaloniaXamlObjectWriter(
     XamlSchemaContext schemaContext,
     XamlObjectWriterSettings settings,
     AvaloniaNameScope nameScope
     )
     : base(schemaContext, settings)
 {
     _nameScope = nameScope;
 }
        public static AvaloniaXamlObjectWriter Create(
            XamlSchemaContext schemaContext,
            AvaloniaXamlContext context,
            IAmbientProvider parentAmbientProvider = null)
        {
            var nameScope = new AvaloniaNameScope { Instance = context?.RootInstance };

            var writerSettings = new XamlObjectWriterSettings()
            {
                ExternalNameScope = nameScope,
                RegisterNamesOnExternalNamescope = true,
                RootObjectInstance = context?.RootInstance
            };

            return new AvaloniaXamlObjectWriter(schemaContext,
                writerSettings.WithContext(context),
                nameScope,
                parentAmbientProvider);
        }