Question

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) ?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top