locked
Split a XAP file up RRS feed

  • Question

  • Is it possible to split up a XAP file into multiple files. I plan are writing an app that will be over 10MB in size and would like to spli the XAP file into multiple XAP files that get loaded in the background once the main one is loaded, or load the XAP file when the user goes to a certain section of the app. A link to a tutorial would be the most helpful.

     

    Thanks for your responses in advance.

    Thursday, November 27, 2008 8:17 PM

Answers

  • Yes you can.   In fact, it is a recommended practice to keep your load times to a minimum and load your assets (i.e. music, graphics/sprites, large data) after loading your UI.  This way the user is not sitting there for 30 seconds watching the loading icon spin.

    If you google dynamic assembly loading you will get a lot of good information.  The basic premise is that each seperate assembly you build in Silverlight will be compiled in a XAP file.  You, then can download these XAP files and load the assemblies dynamically and use their resources and call their methods.

    I have an example on my website here how to download a XAP file dynamically:

    http://www.silverlighthack.com/post/2008/09/29/Silverlight-2-(RC0-RTM)-Dynamic-Assembly-Loading.aspx

    This actually caches the assembly in Isolated Storage so next time you don't have to download all the assets again and only need to download the what is new.  You can use component based design or interface design so that calling your methods can be done easier and not have to use reflection.

    Thursday, November 27, 2008 8:23 PM

All replies

  • Yes you can.   In fact, it is a recommended practice to keep your load times to a minimum and load your assets (i.e. music, graphics/sprites, large data) after loading your UI.  This way the user is not sitting there for 30 seconds watching the loading icon spin.

    If you google dynamic assembly loading you will get a lot of good information.  The basic premise is that each seperate assembly you build in Silverlight will be compiled in a XAP file.  You, then can download these XAP files and load the assemblies dynamically and use their resources and call their methods.

    I have an example on my website here how to download a XAP file dynamically:

    http://www.silverlighthack.com/post/2008/09/29/Silverlight-2-(RC0-RTM)-Dynamic-Assembly-Loading.aspx

    This actually caches the assembly in Isolated Storage so next time you don't have to download all the assets again and only need to download the what is new.  You can use component based design or interface design so that calling your methods can be done easier and not have to use reflection.

    Thursday, November 27, 2008 8:23 PM
  • Thank you very much. I know what I'm learning this weekend. :)

    Thursday, November 27, 2008 8:31 PM