Xamarin PCL中缺少Type.GetProperties() [英] Type.GetProperties() missing in Xamarin PCL
问题描述
在Xamarin PCL中,我试图获取我编写的类的System.Reflection.PropertyInfo,以便可以通过其字符串名称访问/获取其属性以获取/设置,并且缺少Type.GetTypeInfo(),以及Type.GetProperties.但是System.Reflection.PropertyInfo是有效的类.如何获取课程的属性信息?我必须为每个平台写一个包装器吗?(它在Android/iOS项目中显示得很好).
In Xamarin PCL, I'm trying to get the System.Reflection.PropertyInfo of a class I've written so that I can access its properties by their string name to get/set, and Type.GetTypeInfo() is missing, as well as Type.GetProperties. But System.Reflection.PropertyInfo is a valid class. How can I obtain the property info of a class? Do I have to write a wrapper for each platform? (It shows up just fine in the Android/iOS projects).
推荐答案
我刚遇到这个问题,可以肯定的答案是使用:
I have just run into this, pretty sure the answer is to use:
Type.GetRuntimeProperties
这篇关于Xamarin PCL中缺少Type.GetProperties()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!