开发者

Invoking an internal constructor in Silverlight

开发者 https://www.devze.com 2023-03-29 00:11 出处:网络
I\'m trying to use Activator.CreateInstance to create an instance from a type that has an internal constructor, but it doesn\'t work,

I'm trying to use Activator.CreateInstance to create an instance from a type that has an internal constructor, but it doesn't work,

How can I create an instance of an internal class in Silverlight?

开发者_如何学编程

I can get the ConstructorInfo, but I can't invoke it!!!

Does Silverlight support this?


Well, in Silverlight we can't use Activator.CreateInstance to create an instance from an internal class.

We should use Type.InvokeMember and use the BindingFlags.CreateInstance...

0

精彩评论

暂无评论...
验证码 换一张
取 消