Silverlight Display Web Part
I’ll be the first to admit that I’m no Silverlight guru – all those sliding images and reflecting chrome are a bit fancy for my simple country-boy tastes. But I was floored when one of our graphic artists brought me a few samples of some new marketing materials and showed me how he did it. Allright, I give in, this stuff is really cool.
So naturally I wanted to put his fancy Silverlight application on our web site. Only problem is, there doesn’t seem to be an easy way to do that in SharePoint (WSS v3 in our case but the same applies to MOSS). I would have thought that it would all be rendered out to a single object file (like .swf for Flash) and I could just throw an <object> tag into a content editor web part and be done with it. Not so, apparently. The sample templates that ship with Visual Studio 2008 create the whole Silverlight project as a standard web site, with a bunch of images, a handful of javascript and a dll. Now what am I supposed to do with that?
I did some quick searching on the web and all I could come up with was some rough web parts to show Silverlight web sites inside an iFrame. I can do that with a page viewer web part, thank you very much, but that defeats the purpose. Besides, I don’t like having unmanaged paths on my SharePoint servers; if you can’t build it into a web part, server control, or user control then it has no business living on my SharePoint boxes (I know, it probably won’t hurt anything but it’s one of my pet peeves).
So by now I was annoyed by the whole thing and determined to find a fix. The result is a generic Silverlight Display Web Part that I whipped up in about an hour (and most of that was spent figuring out the javascript and xaml pathing issues). The web part is very simple – tell it where to find your basic Silverlight project (I only tested ones created with the sample VS08 project type), give it an ID (in case you want to have more than one on a page), and voila – pretty Silverlight pictures in SharePoint. You can download it here. It’s a .wsp file so your admins shouldn’t give you any grief about deploying it (just remember to activate it in your site collection after deployment).
Instructions for deployment are in the ReadMe file. The most important thing to remember is that the basic VS08 template stuffs everything into a single folder. You’ll need to use virtual paths to get it working inside a SharePoint web application, so be sure to change any fixed references in the default.html.js and scene.xaml files to the correct relative paths (such as ‘/bin/TestProject/image1.png’). And don’t forget to change the control id value in the default.html.js file if you change it in the web part so it will know where to find the right control on the page.
I’m sure there are probably already better solutions out there but I couldn’t find them in the first 100 or so search results and the new CodePlex search is about useless. If you know of anything better please post a comment and enlighten the rest of us Silverlight noobs. As always, if you have questions, issues or feature enhancements, post a comment and you will be heard (I may not do anything about it but at least I promise to read it). Oh, and if you want the source code, just email me and I’ll zip it up and send it to ya.
Was it difficult to implement? Would you be interested in contributing the design and/or code to the CKS:EBE project? If so, please ping the team at cks-ebe@sharepointservers.com.
Was it difficult to implement? Would you be interested in contributing the design and/or code to the CKS:EBE project? If so, please ping the team at cks-ebe@sharepointservers.com.
hi im developing a project for photos .here im displaying a set albums in which each album contains the photos.here i need to display a image on a particular album wen ever i click the particular album it shud be selected and also there should be a checkbox beneath that image album inorder to select particular album.can u plzz specify is there any control in silver light for this purpose or should i use the general control?
I can’t see it in my Site Features list.
I can’t see it in my Site Features list.
Things get posted twice because when you hit submit, you get an error message. But then later you see your comment entered twice. I followed the intructions that come with this and add the webpart, but “Please provide a valid resource location.” on my page.
I discovered a problem in the code last night that caused the web part to fail due to permissions error. I have posted a new version of the .wsp package to the downloads section here: http://www.binarywave.com/products/downloads/Free%20Utilities/BinaryWave.SilverLightWP.zip
Hi, I haven,t see it in my sharepoint features list.
hi
hi
What a fun pattern! It’s great to hear from you and see what you’ve sent up to. All of the projects look great! You make it so simple to this.Thanks!
http://www.nikeairjordan.cc/air-jordan-5-v-19/
I like your posts because they are very exact and important for many people!