|
|
@ -49,7 +49,7 @@ namespace Perspex.Markup.Binding |
|
|
|
|
|
|
|
|
if (target != null) |
|
|
if (target != null) |
|
|
{ |
|
|
{ |
|
|
_propertyInfo = FindProperty(target, PropertyName); |
|
|
_propertyInfo = target.GetType().GetRuntimeProperty(PropertyName); |
|
|
|
|
|
|
|
|
if (_propertyInfo != null) |
|
|
if (_propertyInfo != null) |
|
|
{ |
|
|
{ |
|
|
@ -87,27 +87,6 @@ namespace Perspex.Markup.Binding |
|
|
_propertyInfo = null; |
|
|
_propertyInfo = null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private static PropertyInfo FindProperty(object target, string propertyName) |
|
|
|
|
|
{ |
|
|
|
|
|
var typeInfo = target.GetType().GetTypeInfo(); |
|
|
|
|
|
|
|
|
|
|
|
do |
|
|
|
|
|
{ |
|
|
|
|
|
var result = typeInfo.GetDeclaredProperty(propertyName); |
|
|
|
|
|
|
|
|
|
|
|
if (result != null) |
|
|
|
|
|
{ |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
typeInfo = typeInfo.BaseType?.GetTypeInfo(); |
|
|
|
|
|
} |
|
|
|
|
|
} while (typeInfo != null); |
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void ReadValue(object target) |
|
|
private void ReadValue(object target) |
|
|
{ |
|
|
{ |
|
|
var value = _propertyInfo.GetValue(target); |
|
|
var value = _propertyInfo.GetValue(target); |
|
|
|