Share via


Silverlight Localization using a OOTB Silverlight Web Part and Additional Initialization Parameters

Version: 1.0.0

Description

Localized Silverlight applications do not pick up the SharePoint site's current user interface culture. This lab demonstrates code that will retrieve a parameter from InitParams and set the application's CurrentUICulture to match the culture passed in. The out-of-the-box Silverlight Web Part provides a Web Part property to set additional initialization parameters.

Overview

Localized Silverlight applications do not pick up the SharePoint site’s current user interface culture. This lab demonstrates code that will retrieve a parameter from InitParams and set the application’s CurrentUICulture to match the culture passed in. The out-of-the-box Silverlight Web Part provides a Web Part property to set additional initialization parameters.

Objectives

This lab will demonstrate how to modify a localized Silverlight application to set it’s CurrentUICulture to match a value passed to the application using InitParams.

  • Modify an existing localized Silverlight application to retrieve an InitParam key and set the CultureInfo.
  • Deploy and test the solution displaying French on an English-language site d.

System Requirements

You must have the following items to complete this lab:

  • 2010 Information Worker Demonstration and Evaluation Virtual Machine
  • Microsoft Visual Studio 2010
  • Visual Studio 2010 SharePoint Power Tools
  • Silverlight 4 Toolkit
  • Silverlight WebPart

Setup

You must perform the following steps to prepare your computer for this lab...

  1. Download the 2010 Information Worker Demonstration and Evaluation Virtual Machine from https://tinyurl.com/2avoc4b and create the Hyper-V image.
  2. Install the Visual Studio 2010 Silverlight Web Part. The Silverlight Web Part is an add-on to Visual Studio 2010 and can be downloaded from https://code.msdn.microsoft.com/vsixforsp.
  3. Install the Silverlight 4 Toolkit located at https://silverlight.codeplex.com/
  4. Install the Visual Studio 2010 SharePoint Power Tools located at https://visualstudiogallery.msdn.microsoft.com/en-us/8e602a8c-6714-4549-9e95-f3700344b0d9

Exercises

This Hands-On Lab comprises the following exercises:

  1. Modify the Existing Localized Silverlight Application to retrieve the UICulture from InitParams
  2. Deploy and Test the Modified Silverlight Application

Estimated time to complete this lab: 20 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 location>\Labs\SLLocalizationOOTBSLWebPart\Source\Begin\OOTB_SLWebPart_Localization.sln: This solution contains a starter custom Silverlight Web Part and a starter localized Silverlight application.
    Note:
    Inside each exercise folder, you will find an end folder containing a solution with the completed lab exercise.