Correctly handle attached properties on root instance.

Fixes #61.
This commit is contained in:
Steven Kirk 2015-12-01 21:11:56 +01:00
Родитель 3e3b46ba66
Коммит f2673838c0
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -74,9 +74,13 @@ namespace OmniXaml.ObjectAssembler
private XamlMemberBase GetMember(XamlMemberBase member)
{
if (IsLevelOneAndThereIsRootInstance && !member.IsDirective)
if (IsLevelOneAndThereIsRootInstance && !member.IsDirective && rootInstanceXamlType != null)
{
return rootInstanceXamlType == null ? member : rootInstanceXamlType.GetMember(member.Name);
var attachable = member as AttachableXamlMember;
member = attachable != null ?
(XamlMemberBase)attachable.DeclaringType.GetAttachableMember(member.Name) :
(XamlMemberBase)rootInstanceXamlType.GetMember(member.Name);
}
return member;