Silverlight Reflection

In ASP.NET, for example, we could think of assemblies in AppDomain or use a type in which we could get metadata about the class (details, methods, etc.). What is the method used to retrieve metadata in a class, retrieve dependency properties, etc. In Silverlight?

+6
reflection c # silverlight
source share
3 answers

Reflection exists in Silverlight with a subset of the APIs introduced on the full .NET Framework.

One noticeable difference is that you cannot think about private Silverlight members (or maybe you can in your own assembly, but the boundaries should become obvious pretty quickly). This is a security feature that ensures that you will not bother with the internal elements of the structure itself.

In addition to this (true, rather large) limitation, the reflection should be basically the same.

+5
source share

In addition to what Austin said, the rule with Reflection in Silverlight is that you can only access through reflection, which you can access with regular code. Therefore, this is not only about private members. You can display protected members only in the class itself or in any class that inherits it.

There are many missing parts to the API, but in general most things should be possible, even if they need a little more work than the full version of .NET.

+4
source share

Security Considerations for Reflection Reflection provides the ability to obtain information about types and members, and to access elements. In Silverlight, you can use reflection to perform the following tasks:

List the types and elements and view their metadata.

List and view assemblies and modules.

Access to open members.

Access to internal members (Friend members in Visual Basic) in the assembly of the calling code. (In reflection, this is called assembly level access.)

In Silverlight, you cannot use reflection to access private types and members. If the access level of a type or member does not allow you to access it in a statically compiled code, you will not be able to access it dynamically using reflection.

0
source share

All Articles