mardi 12 mai 2020

How to get the properties of object collection list using Reflection in WPF

I am trying to get the properties of instance which is of List collection type as like below code:

List cars = new List(){ "Volvo", "BMW", "Ford", "Mazda" }; PropertyDescriptorCollection propertyDescriptors = TypeDescriptor.GetProperties(cars);

enter image description here

But, i am getting only the default properties (Capacity and Count) of List type. Instead of default properties, i need to retrieve Volvo, BMW properties in PropertyDescriptorCollection. Can anyone please suggest solution regarding this query.





Aucun commentaire:

Enregistrer un commentaire