|
@@ -10,16 +10,15 @@ namespace Avalonia.Markup.Xaml.PortableXaml
|
|
|
{
|
|
{
|
|
|
public static AvaloniaXamlObjectWriter Create(
|
|
public static AvaloniaXamlObjectWriter Create(
|
|
|
XamlSchemaContext schemaContext,
|
|
XamlSchemaContext schemaContext,
|
|
|
- object instance,
|
|
|
|
|
AvaloniaXamlContext context)
|
|
AvaloniaXamlContext context)
|
|
|
{
|
|
{
|
|
|
- var nameScope = new AvaloniaNameScope { Instance = instance };
|
|
|
|
|
|
|
+ var nameScope = new AvaloniaNameScope { Instance = context?.RootInstance };
|
|
|
|
|
|
|
|
var writerSettings = new XamlObjectWriterSettings()
|
|
var writerSettings = new XamlObjectWriterSettings()
|
|
|
{
|
|
{
|
|
|
ExternalNameScope = nameScope,
|
|
ExternalNameScope = nameScope,
|
|
|
RegisterNamesOnExternalNamescope = true,
|
|
RegisterNamesOnExternalNamescope = true,
|
|
|
- RootObjectInstance = instance
|
|
|
|
|
|
|
+ RootObjectInstance = context?.RootInstance
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
return new AvaloniaXamlObjectWriter(schemaContext,
|
|
return new AvaloniaXamlObjectWriter(schemaContext,
|