简体   繁体   中英

Can I dynamically add a user control to a silverlight application without recompiling it?

I have a silverlight application with several menu buttons, each of which opens up a user control in a center "work space" area. It works fine. Now what I'd like to do is make some more user controls, compile them into a dll, and through say, a configuration file, have the silverlight app add a new menu button and make it make one of those new controls appear. The difficult part is, I'd like to be able to do this without recompiling the silverlight app. I'd like another developer to be able to make a user control that does some things, compile it into a dll, and drop it into the silverlight directory with some changes to a config file to get the main app to load it in. Is there a way I could do this?

Since noone else has replied yet:

What you want to do is reflect classes form a third-party dll at runtime. This is possibly too big a subject for SO, and all I can really recommend is looking up examples of it, and maybe the msdn section on it .

You'll also want to look up serialization and deserialization in C# and silverlight ( this question might be a good start).

Sorry I can't be more help than that, but hopefully someone more experienced will weigh in with a useful article or some such.

Good luck :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM