Domanda

Is it possible somehow to access non-public properties in Silverlight? Maybe using reflection?

I've tried following steps:

  1. Get class type
  2. Get property info by prop name
  3. prop.GetValue(obj, null)

It says: MethodAccessException... A there any ways to workaround/(go another way) ?

È stato utile?

Soluzione

Officially, you will need to run the browser in elevated permissions in order to access private/protected members. With normal privileges reflection will only get you access to the members in the same assembly.

http://msdn.microsoft.com/en-us/library/stfy7tfc(v=vs.95).aspx

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top