locked
load entire silverlight project at beginning instead of loading as you go to each page RRS feed

  • General discussion

  • Hi, I'm looking to cut down the time it takes for each page to load when you go to it the first time. Is there some way to just download the whole site when you first come to it?

    Thursday, July 5, 2007 4:42 PM

All replies

  • Hello,

    You can utilize the "Downloader" object to download the contents of your site.

    If this answers your question, please select "mark as answer", otherwise, please post a followup question.

    Thank you,

    Chad Campbell

    Thursday, July 5, 2007 4:53 PM
  • are you talking about the createfromxamldownloader?

    Thursday, July 5, 2007 5:00 PM
  • I've looked at it and frankly I'm a little confused... How is it used exactly?

    Thursday, July 5, 2007 5:05 PM
  • The downloader lets you zip up objects and extract them at run-time.

    Typical examples have pictures and/or xaml in the file.

    At run-time you Create a downloader object, a callback event handler set up for when the download is complete, and  then do a downloader.open of the zip file.

    When the callback hits, you can then pull the objects out of the zip file for use, such as using createFromXaml on some xaml in the zip.

    once you get the xamlFragment from the downloader using a getResponseText call, you use it like any other xamlFragment.

    -Dave

    Thursday, July 5, 2007 5:33 PM
  • I am assuming you are using Silverlight 1.0.  The Downloader object allows you to download content that can be used within a Silverlight application.  The Downloader object actually allows you to download complete .zip files.  I mention this because in yoru situation of wanting to download an entire site, you could do the following:

    • Create a Silverlight control that loads references a "loader" animation in a file called "loader.xaml"
    • When the main canvas of the loader.xaml file is loaded, create a Downloader object that references the zip file that contains your site.
    • when the onCompleted event of the Downloader object is executed, begin your site.  At this point, you can have access to all of the Silverlight content used by your site.

    Does this make sense, if not, please let me know and I will go into further detail.  Also, please specify if you are using Silverlight 1.0 or 1.1 so that I can assist in the most appropriate manner.

    Thank you,

    Chad Campbell

    Thursday, July 5, 2007 5:35 PM
  •  The concept of downloading the full zip file is understood.

    The contents of zip file can be accessed in the "completed" event, but what if I have to access some image or xaml file from the zip file after sometime. How do we do that.

     Thanks
     

    Monday, December 31, 2007 6:33 AM