6

I wanted to try was to make an asp website which would include pictures in multiple Silverlight galleries. The reason why I want to do this is that I want something in this fashion:

Text describing some places.
Gallery with several pictures that are relevant for the text.
Text describing some other places.
Gallery with several pictures that are relevant for the other places.
etc.

I managed to use the popular SlideShow2 (http://slideshow2.codeplex.com/) but I ran into problems with multiple instances of the Silverlight object. If I put two galleries on the page they work correctly, if I put more of them then two of them work (oddly for example first and third out of nine). Is there some Silverlight restriction for a size of objects you can load? Also - is it a reasonable approach to place the object there more times? I wonder if it is a big slowdown.

Anyway, what would you suggest to use for the described scheme? I don't necessarily require a slideshow of the pictures (though it would be nicer) but I would like the galleries to be in Silverlight.

EDIT - Slideshow2 link corrected

Euqil
  • 391
  • 1
  • 10
  • When say that only two of them work, what happens to the others? Do they load partially? Not at all? Do you receive any error messages? – NakedBrunch May 21 '11 at 16:25
  • first one loads with most of the pictures (note that not with all), second one loads with a couple of pictures (also not all), third one and on load - but then nothing happens. I played with it for a while and I found out that the scenario is possibly following: 1) first one loads and starts to get pictures 2) second one loads, sets some global value and starts to load pictures 3) third one and on load very fast after and nothing loads from that moment – Euqil May 24 '11 at 06:02
  • Tell us more about the pictures. How big are they? Are the thumbnails pre-computed? What is being sent to the user? – tofutim May 24 '11 at 06:09
  • The pictures are in two resolutions, all jpegs. The smaller pictures have 1600*1200, the bigger ones are I think 2048*1536. For the gallery it is also possible to specify thumbnails. I tried two sizes - 320px wide and 75 px wide. Both with same results. When I tried to use completely different picture for the thumb it worked. Maybe it is possible that the actual pictures get loaded. Anyway if I put all photos into one slideshow applet it works fine. If I use more of these applets, it is broken. – Euqil May 24 '11 at 10:41

2 Answers2

1

First off, make sure you're using the updated SlideShow2 (http://slideshow2.codeplex.com/). Your post mentioned the older SlideShow1.

This issue might be related to the order in which the browser is rendering the Silverlight object. Try instantiating the Silverlight object using the Javascript CreateObject function in Silverlight.js.

  1. Remove all of the declarative objects as mentioned in Step 1 of the Quick Start Guide
  2. Add the following script for each of your galleries:

.

document.write("<div id=\"silverlightControlHost\">");  
Silverlight.createObject("http://PathToMyXAP/MyXap.xap", document.getElementById('silverlightControlHost'),"slPlugin",
     {
          //Enter XAP params here
     },
    { onError: onSilverlightError }
); 
NakedBrunch
  • 48,713
  • 13
  • 73
  • 98
  • I do use the SS2 (my link was wrong, which is now edited). I will try this and let you know. – Euqil May 24 '11 at 14:24
0

If you find a Gallery using a later version of Silverlight, the performance might be greatly improved.

tofutim
  • 22,664
  • 20
  • 87
  • 148
  • Online or locally it will be the same, because Silverlight runs locally inside your browser. I think the issue is that the Slideshow code, written for SL2, is not exactly lightweight. Having multiple instances will be pretty tough on the user. If you know what you want to achieve, some dedicated smaller SL apps might give a better result. – tofutim May 24 '11 at 06:04
  • sorry, I edited the post before you replied - I understood your answer wrong at first... – Euqil May 24 '11 at 06:05
  • The image loading might be an issue also... are you sending all the images to the user? – tofutim May 24 '11 at 06:06
  • Problem is that I didn't find any that would be in newer Silverlight – Euqil May 24 '11 at 06:06
  • There is a way how to set thumbnails, so the actual resolution should be lower up to the point when you actually click on the picture – Euqil May 24 '11 at 06:08
  • Perhaps it would help if you gave more information about the size of the pictures, where they are stored, and the effect you want to achieve. I'm guessing what you want is text, then a photo strip, then text, then a photo strip, etc. Ideally the Silverlight photo strip pulls thumbnails from your server, than gives a larger image when the user hovers over the text. – tofutim May 24 '11 at 06:08
  • see comments under the other answer – Euqil May 25 '11 at 11:35