In the context of a Windows Universal Application, and using reflection, I'm trying to get the Add
method from a ColumnDefinitionCollection
(the built-in type)
So I use this:
type.GetRuntimeMethods().First(info => info.Name == "Add");
BUT it returns null!
It also happens with the Contains
method. Both of them are defined in ICollection<T>
(IList<T>
derives from it).
However, if I define my own class deriving from IList<T>
, it works perfectly.
Then, how do I get a MethodInfo for the Add method?
Is ColumnDefinitionCollection
using some tricks? Maybe something related to COM?