With ASP.NET, for instance, we could reflect on the assemblies in an AppDomain, or using the type we could get the metadata about the class (props, methods, etc.). What is the technique used to extract metadata on a class, extract dependency properties, etc., in Silverlight?
Reflection exists in Silverlight, with a subset of the APIs provided in the full .NET Framework.
One notable difference is that you can't reflect onto private members in Silverlight (or maybe you can inside your own assembly, but the boundaries should become apparent pretty quickly). This is a security feature to ensure you don't go messing with the internals of the framework itself.
Other than that (admittedly, rather large) limitation, Reflection should be basically the same.
In addition to what Austin said, the rule with Reflection in Silverlight is that you can only access via reflection whatever you could access via normal code. So it's not just about private members. You can reflect over protected members only in the class itself or in any class inheriting it.
There are numerous missing pieces of the API but in general most things should be possible, even if they require a bit more work than in full .NET
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With