Implement TypeDescriptionProvider / HyperDescriptor

I am currently populating my WPF grid using a data collection that implements ITypedList, with contained objects implements ICustomTypeDescriptor. All properties are determined at runtime.

I want to implement HyperDescriptor to speed up performance, but the example on this page is more about known types, not about runtime properties,

I would think that I would need to implement my own method GetProperties()or similar to tell HyperTypeDescriptor what properties it needs to see, but I'm not sure where this should be set. I think this is not difficult, but I obviously missed something.

Any helpful tips!

+5
source share
1 answer

The implementation is HyperDescriptorreally specific for compile-time properties, as it uses ILGenerator, etc. and caches the generated code. If you use ICustomDescriptor, you are already in a very different performance profile, for example, if your user PropertyDescriptorworks with a dictionary or hash table as a bag with characteristics, it can be much faster than the initial reflection.

It may be possible for further optimization, but I will need to learn more about the specific implementation. But that would be a non-trivial job, so first make sure that this member access is actually a bottleneck and that you could not do something as simple as paging or "virtual mode" in the first place.

(: HyperDescriptor, )

+4

All Articles