Skip to content

Commit

Permalink
fix: ElementStub's Name is not set if visibility has been data bound
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb authored and jeromelaban committed Oct 21, 2020
1 parent d3600b9 commit f4bb7ac
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4990,6 +4990,19 @@ private IDisposable TryGenerateDeferedLoadStrategy(IIndentedStringBuilder writer
BuildComplexPropertyValue(innerWriter, def, closureName + ".", closureName);
}
if (nameMember != null)
{
innerWriter.AppendLineInvariant(
$"{closureName}.Name = \"{nameMember.Value}\";"
);
// Set the element name to the stub, then when the stub will be replaced
// the actual target control will override it.
innerWriter.AppendLineInvariant(
$"_{nameMember.Value}Subject.ElementInstance = {closureName};"
);
}
if (hasVisibilityMarkup)
{
var def = new XamlMemberDefinition(
Expand Down Expand Up @@ -5032,19 +5045,6 @@ private IDisposable TryGenerateDeferedLoadStrategy(IIndentedStringBuilder writer
BuildLiteralValue(visibilityMember)
);
}
if (nameMember != null)
{
innerWriter.AppendLineInvariant(
$"{closureName}.Name = \"{nameMember.Value}\";"
);
// Set the element name to the stub, then when the stub will be replaced
// the actual target control will override it.
innerWriter.AppendLineInvariant(
$"_{nameMember.Value}Subject.ElementInstance = {closureName};"
);
}
}
}
}
Expand Down

0 comments on commit f4bb7ac

Please sign in to comment.