C# 如何在Windows应用商店应用程序中使用C中的反射仅获取公共属性
我正在使用C# 如何在Windows应用商店应用程序中使用C中的反射仅获取公共属性,c#,winrt-xaml,C#,Winrt Xaml,我正在使用 typeof(ClassName).GetRuntimeProperties() 此方法将显示所有属性。你将如何从一个没有绑定标志的类中获得唯一的公共属性,任何可能的方式请让我知道 IEnumerable<PropertyInfo> properties = typeof(TClass) .GetRuntimeProperties() .Where( pi => pi.CanRead && pi.GetGe
typeof(ClassName).GetRuntimeProperties()
此方法将显示所有属性。你将如何从一个没有绑定标志的类中获得唯一的公共属性,任何可能的方式请让我知道
IEnumerable<PropertyInfo> properties =
typeof(TClass)
.GetRuntimeProperties()
.Where( pi => pi.CanRead && pi.GetGetMethod().IsPublic );