Tuesday, December 1, 2009

How to build the Silverlight web part?

Steps to create this on your own site using SharePoint Designer (no server access or web part installation required).

Note: Copy any code below into notepad first. Only PNG and JPG are supported by Silverlight 1.0.

Assuming you have a SharePoint picture library already created.

  1. Create a Document Library to hold your web part page and the required SilverLight files (set template to Web Part Page)
  2. Create a folder called script in the document library
  3. Copy the following files from http://www.codeplex.com/bjsspv/Release/ProjectReleases.aspx?ReleaseId=6444 into the script folder
    1. Createsilverlight.js
    2. Main.js
    3. Silverlight.js
    4. Scene.xaml
    5. Photoitem.xaml
  4. Create a Web Part Page in the library
  5. Edit the web part page in SharePoint Designer
  6. Insert a Data View of your picture Library (just select one field from the data source view)
  7. Set the data view layout to Plain Layout
  8. Add the following code immediately before the tag in the




    Loading...]]>

  9. Replace the dvt_1 template with the following


    PlnTitl

]]>

  • Replace all the code between the with

    localScene.PhotoItemsUrls[''] = new BinaryJamSFSPartPhotoUrls('http://www.wssdemo.com','http://www.wssdemo.com/today/_t/_.jpg');

    This adds the image url and calculates the thumbnail for the image (_ext.jpg). Substitute www.wssdemo.com with your site url and Today with your picture library. Important: If your picture library is in a sub site, the first URL should be to your root site collection, not the sub site.

  • Save your page and view it in the browser (mouse over the bottom of the image to get the selector to display)
  • No comments: