Type.GetProperties() missing in Xamarin PCL

后端 未结 3 1158
难免孤独
难免孤独 2021-01-01 15:54

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.

3条回答
  •  执笔经年
    2021-01-01 16:21

    You can also try

    using System.Reflection; 
    
    Type t = typeof(YOURTYPE);
    var properties = t.GetTypeInfo().DeclaredProperties
    

提交回复
热议问题