locked
Dynamic content RRS feed

  • Question

  • Hi

    We have had a request to be able to generate content within our silverlight app on the fly including menus, tables and charts etc by allowing another team to produce external XML files which we then process and use to dynamically generate the appropriate SL objects. Has anyone done anything similar and are there are pointers that anyone can offer? My first concern is how responsive this all might be and whether or not it might be possible to dynamically modify the given XAP file instead.

    Thoughts would be appreciated.

    Thanks

    Thursday, September 16, 2010 8:31 AM

Answers

  • Closest I have come to this was:

     

    We have a form designer for custom documents in a .net windows app. (not silverlight), control positions and attributes are stored in a database. Now the client must be able to access his custom-layout documents in Silverlight and the controls are placed on a Canvas using code and the attributes in the database. So far it is pretty responsive given that the code to render runs on client side. Fairly different to what you want to do but I thought I'd tell you anyway.

    Thursday, September 16, 2010 9:03 AM
  • In my opinion, you can not modify xap file. If there is a need to load different assemblies, you should break your xap file in smaller xaps and load them as and when required. 

    Thursday, September 16, 2010 9:32 AM

All replies

  • Closest I have come to this was:

     

    We have a form designer for custom documents in a .net windows app. (not silverlight), control positions and attributes are stored in a database. Now the client must be able to access his custom-layout documents in Silverlight and the controls are placed on a Canvas using code and the attributes in the database. So far it is pretty responsive given that the code to render runs on client side. Fairly different to what you want to do but I thought I'd tell you anyway.

    Thursday, September 16, 2010 9:03 AM
  • In my opinion, you can not modify xap file. If there is a need to load different assemblies, you should break your xap file in smaller xaps and load them as and when required. 

    Thursday, September 16, 2010 9:32 AM
  • In my opinion, you can not modify xap file.

     

     

    Note sure, but I think you can use reflection to modify xap. It will be a lot of work though

    Thursday, September 16, 2010 9:41 AM
  • Okay so the two options would be to

    • read in xml and then dynamically create controls (grids, charts etc) at runtime; or
    • have a separate process that reads xml file(s) and constructs a xap from then and then have this xap injected into main application.

    I have to say that of the two the first sounds easier to get off the ground - just have to see how it performs I suppose.

    Thursday, September 16, 2010 10:45 AM
  • Hi,

    The first one is definitely easier one. And In my opinion it should not have performance issue, apart from parsing the xml.

    Thanks,
    Radhey 

    Friday, September 17, 2010 12:39 AM