Categories: .Net, Silverlight Posted by mheydt on 8/28/2007 1:35 AM | Comments (0)

Over the last few days I've decided to start working on some Silverlight content for the site.  I decided to use this as I was looking for a good picture gallery for the site.  I initially found simpleviewer from airtightinteractive.com.  SimpleViewer is a flash object for displaying photo galleries, and I really like what it can do (you can see an example here).  I did find the code way too complicated for my liking, and I didwrap all of this so that it can be run in an asp.net web control to hide all of the gory details of setting up the flash. 

Also from Airtight Interactive is a post card gallery, which I really liked.  Unfortunately, that control is really limited in its free version, to the point that I don't want to use it and don't want to buy it as I would think I can find something similar elsewhere.

So, I figured that since Silverlight is supposedly so neato, I decided to start looking for Silverlight photo gallery controls.  There are a few basic demos out there, but I didn't really find anything really suitable, exception for potentially the Silverlight Surface Demo.  I really like this, and to great lengths it is very similar to the post cardviewer that I'd like, so I figured I'd go about modifying the code to get it to do operate this way (as well as to learn Silverlight).

I immediately came upon a problem in the code that I needed to address.  The demo code has a fixed set of images that are hard coded by name into the application.  Sure, they are downloaded dynamically to the client, but the set of files is fixed.  Given I would like to reuse the control to display multiple sets of galleries, I needed to figure out how to provide a dynamic list of files to the Silverlight control.

This was not exactly easy to figure out.  There were several issues that I had identified.  First, most demos I could find utilized .HTML files, not .aspx files.  So, this inherently wouldn't let me write code-behind to process parameters.  Second, I could find no examples of how to pass dynamic (or static) data from the page into the silverlight control.  Third, was how to program the silverlight control to retrieve data from the back end dynamically from the page based upon data passedinto the control.

 

Comments