Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Combination of ICustomTypeDescriptor and IntrospectionExtensions::GetTypeInfo

$
0
0

Hello All,

I'm implementing some types that dynamically define properties for use with data binding. I've implemented ICustomTypeDescriptor on my types and, by and large, that works fine. I've been able to bind to the properties that I publish through ICustomTypeDescriptor. I'm a happy chap.

However, I've just come across a new potential consumer of my data , and this consumer is using object.GetType().GetTypeInfo().GetDeclaredProperty(propertyName) to determine the existence of a property (not ICustomTypeDescriptor.GetProperties) .  So, GetTypeInfo is not using my ICustomTypeDescriptor implementation to get the PropertyDescriptors, and so the binding is failing.

So, how to I get the TypeInfo returned from GetTypeInfo to honour my ICustomTypeDescriptor? Do I need to implement IReflectableType? If so I can't see where to do that.

I hope that all makes sense,

John


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>