Xamarin View获取属性的绑定信息

        public static Binding GetBinding( BindableObject self, BindableProperty property)
        {
            var methodInfo = typeof(BindableObject).GetTypeInfo().GetDeclaredMethod("GetContext");
            var context = methodInfo?.Invoke(self, new[] { property });

            var propertyInfo = context?.GetType().GetTypeInfo().GetDeclaredField("Binding");
            return propertyInfo?.GetValue(context) as Binding;
        }

 

转载于:https://www.cnblogs.com/IWings/p/9530240.html

你可能感兴趣的:(Xamarin View获取属性的绑定信息)