I'm going through these questions myself right now.

I've got some image files and some XML files. I tried putting everything
into the xap file. It ended up 5Mb (I've cut it down to 1Mb) which doesnt
seem very much but would you believe I'm shaped at the moment so it was
REALLY noticable. You don't want to be hitting a "web site" and have to wait
over a minute to load it. You would lose about 99% of your users from them
getting impatient and clicking close.

So after removing the duplicate images from the file (I could also make the
images smaller/higher compression but would rather I didnt have to), I
decided to move the images into the ClientBin and change the Build Action
from Content to None (with copy if newer). The application loads much faster
but now when I click throught he content there is a delay as the images get
downloaded when needed rather than all at the start. It's a trade off, do
you download everything at the start or only when they need it. The later is
better on bandwidth but the app doesnt flow as nice if it is downloading
images.

I wonder if there is a way to predownload the images... I've not yet looked
at the WebClient for downloading files. I would like to have a package (zip
file?) which contains the "content" and have the essentials of the app in
the xap. Then I'd have the best of both worlds. If I'm downloading a file
I'm assuming it only gets downloaded once and then I can pull resources out
of it as many times as I want?

using WebClient to download the file and then GetResourceStream to get the
contents out of it, right?

Having fun here. :)

cheers,
Stephen
On Fri, May 16, 2008 at 1:16 PM, Ola Karlsson <[EMAIL PROTECTED]> wrote:

>  Hi people,
>
>
>
> I'm hoping to pick your brains on  the "best way" of reading an XML file in
> SL 2. J
>
>
>
> I've seen a few different approaches floating around on the web and I've
> listed some below.
>
>
>
> ·         Add the XML document as an Embedded resource in the Silverlight
> project and then use XDocument.Load
>
> ·         Add the XML document to the Silverlight project and use the
> Webclient class, with a  relative path from the ClientBin directory.
>
> ·         Add the XML document to the Web project calling the Silverlight
> project and use the HttpWebRequest class with a absolute path to the file.
>
>
>
> The way I understand it, if you embed the resource it will get downloaded
> in the .xap file and I guess if it's a small file this could be appropriate?
>
> In regards to the two other I don't know if there's a difference but using
> the HttpWebRequest seems like overkill if you're just reading in a simple
> file?
>
>
>
> Basically I was hoping to get some thoughts and pointers on when what
> approach might be applicable.
>
>
>
> Cheers,
>
> Ola
> -------------------------------------------------------------------
> OzSilverlight.com - to unsubscribe from this list, send a message back to
> the list with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net



------------------------------------------------------------------- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.

Powered by mailenable.com - List managed by www.readify.net

Reply via email to