Accessing SharePoint Data with the Silverlight Client Object Model

Version: 1.0.0

Description

The SharePoint Silverlight Client Object Model (Client OM) allows developers to interact with SharePoint from their Silverlight application easily - without having to write and deploy server-side code and without having to depend on the SharePoint web services and their inherent limitations and complexity. This demo will show basic interaction between a Silverlight application and SharePoint list data - specifically focusing on creating, reading, updating and deleting SPListItems directly from Silverlight and without requiring any server-side code.

Overview

The SharePoint Silverlight Client Object Model (Client OM) allows developers to interact with SharePoint from their Silverlight application easily - without having to write and deploy server-side code and without having to depend on the SharePoint web services and their inherent limitations and complexity. This demo will show basic interaction between a Silverlight application and SharePoint list data – specifically focusing on creating, reading, updating and deleting SPListItems directly from Silverlight and without requiring any server-side code.

Objectives

This lab will demonstrate how to use the Silverlight Client object model to interact with SharePoint list items.

System Requirements

You must have the following items to complete this lab:

  • 2010 Information Worker Demonstration and Evaluation Virtual Machine
  • Microsoft Visual Studio 2010
  • Silverlight 4
  • Silverlight web part extension for Visual Studio
  • Silverlight 4 Toolkit

Setup

The setup and configuration for this demo involves the following tasks:

  • Task 1: Start the Microsoft 2010 Information Worker Demonstration and Evaluation Virtual Machine (RTM).
  • Task 2: Make sure that Silverlight version 4 is installed on the machine
  • Task 3: Install the Silverlight Web parts Extensions into Visual Studio 2010
  • Task 4: Make sure that the Silverlight 4 Tools for Visual Studio are installed on the machine
  • Task 5: Configure the environment for this demo

Task 1 – Start the Microsoft 2010 Information Worker Demonstration and Evaluation Virtual Machine (RTM)

  1. Follow the instructions in the Virtual Machine Setup Guide.docx file you will find at the following location:

https://www.microsoft.com/downloads/en/details.aspx?FamilyID=751fa0d1-356c-4002-9c60-d539896c66ce&displaylang=en

Task 2 – Make sure that Silverlight version 4 is installed on the machine

  1. Download Silverlight 4 from here: https://www.silverlight.net and install

Task 3 – Install the Silverlight Web parts Extensions into Visual Studio 2010

  1. Download the Silverlight and SharePoint VSIX extensions from here: https://code.msdn.microsoft.com/vsixforsp/Release/ProjectReleases.aspx?ReleaseId=4177
  2. Extract the files to your hard drive
  3. Close Visual Studio if it is open
  4. Double-click on the VSIX.SharePoint.Silverlight.vsix file to run the extension installer

Task 4 – Make sure that the Silverlight 4 Tools for Visual Studio are installed on the machine

  1. Download from here: https://www.microsoft.com/downloads/en/details.aspx?FamilyID=b3deb194-ca86-4fb6-a716-b67c2604a139 and install

Task 5 – Configure the environment for this demo

  1. Run the SetupLab.cmd file from the <INSTALL>\Labs\IntroducingSLObjectModel\Source folder to establish the SharePoint environment necessary for this lab

Exercises

This Hands-On Lab encompasses the following exercises:

  1. Reading an existing SPListItem
  2. Creating a new SPListItem
  3. Editing an SPListItem
  4. Deleting an SPListItem

Estimated time to complete this lab: 30 minutes.

Starting Materials

This Hands-On Lab includes the following starting materials.

  • Visual Studio solutions. The lab provides the following Visual Studio solutions that you can use as starting point for the exercises.
    • <INSTALL>\Labs\IntroducingSLObjectModel\Source\Begin\IntroducingSLCOM.sln: This solution contains the initial starting point for all of the exercises in this lab.
    Note:
    Inside each exercise folder, you will find an end folder containing a solution with the completed lab exercise.