Share via


Walkthrough: Write a Silverlight Application for the Conversation Window Extension (Lync 2010 SDK)

This topic shows how to create a simple Microsoft Silverlight application and use Microsoft Lync 2010 SDK to run it in Microsoft Lync 2010 Conversation Window Extension (CWE). The method for displaying a Silverlight application in CWE is simply to embed the application in an HTML page, and display the HTML page in CWE.

This walkthrough topic describes creating and installing a simple Silverlight application and HTML page to represent a real world application in a unified communications scenario. In a production environment, substitute an application install procedure that places the Silverlight application and Web page on the appropriate client computers. The application and Web page must be registered on each sending and receiving client computer.

Prerequisites

For a list of prerequisites, see Walkthrough: Presence Hello World. In addition, install Internet Information Services on both the sending and receiving client computers.

Create a Sample Silverlight Application

Create a Silverlight application to run in the Lync 2010 CWE, or use the ProposalTracker sample application. ProposalTracker demonstrates the use of Microsoft Lync controls in a Silverlight application. It is available at Microsoft Lync\SDK\Samples\ProposalTracker.

Create a GUID for the Silverlight application. For more information, see the topic Create GUID (guidgen.exe)

Create a Sample Web Application

You can use your own Web application, or create one using the following HTML. The object tag will contain the Silverlight application and determine how much space it occupies in the HTML page. Note that the values of the width and height parameters of the object tag should be greater than the UserControl.DesignHeight and UserControl.DesignWidth properties of the Silverlight application.

To create a simple HTML page

  1. Create a new .html file using the following HTML text.

    <html>
    <head>
    </head>
    <body>
    <object width="300" height="300" 
    data="data:application/x-silverlight-2," 
    type="application/x-silverlight-2" >
    <param name="source" value="myApplication.xap"/>
    </object>
    <p>Text in an HTML paragraph element</p>
    </body>
    </html>
    
  2. Save the .html file.

  3. Copy the .xap file from the Debug/Bin file of the Silverlight project to the same folder as the HTML file.

  4. In the HTML file, edit the value element of the param tag to match the .xap filename.

Register the Application

Use registry entries to register the Silverlight application with Lync 2010. For details, in the topic Walkthrough: Perform Install Registration for an Extensibility Application (Lync 2010 SDK), see the section Adding Registry Entries. The GUID you add to the registry for this walkthrough must match the value you created in the earlier procedure To create the Silverlight application.

Run the Application in Conversation Window Extension

If the application is registered as a default application using the DefaultContextPackage registry key, open a conversation window. The Lync Conversation Window Extension appears with your Silverlight application. The application is usually not the default application. In this case, the application must be registered on the sending and receiving computers, and the sending computer specifies the application in the message context data.

See Also

Other Resources

Lync Extensibility API Contextual Conversations (Lync 2010 SDK)