I assume your actual type implements ICustomTypeDescriptor
; if that is the case, then only the TypeDescriptor.GetProperties(object)
API can access the data, as it isn't willing to create an ad-hoc instance to get the properties (and indeed, it is pretty common that if the type implements ICustomTypeDescriptor
, the properties vary per instance, so it wouldn't be useful anyway).
If you want the entire type to support this, you need to create and register a TypeDescriptionProvider
. This works at a higher level, and allows custom properties to apply to the type without needing to consider an instance. The nice thing about this is that it will automatically also apply to lists etc, without needing to implement ITypedList
.
So basically: research TypeDescriptionProvider
.