This topic demonstrates how to add a PresenceIndicator control to Microsoft Lync Control applications, using Microsoft Silverlight or Microsoft Windows Presentation Foundation (WPF).

Use the PresenceIndicator control to display the presence and availability of individual users.

Prerequisites

  • Microsoft Lync 2010 SDK.

  • A connection to Microsoft Lync Server 2010.

  • Microsoft Lync 2010.

  • Supported operating systems: Microsoft Windows 7, Microsoft Windows Server 2003, Microsoft Windows Server 2008, Microsoft Windows Vista, and Microsoft Windows XP.

  • One of the following: Microsoft Silverlight 4 SDK, Microsoft .NET Framework 3.5 SP1, or .NET Framework 4.0.

  • For WPF applications, one of the following editions of Microsoft Visual Studio development system: Visual Studio 2008 SP1 Standard Edition, Professional Edition, or Team Suite, Visual Basic 2008 Express Edition, Visual C# 2008 Express Edition, Visual Studio 2010 Professional, Premium, or Ultimate, Visual Basic 2010 Express, or Visual C# 2010 Express.

  • For Silverlight applications, Microsoft Internet Explorer 7 or Internet Explorer 8, Microsoft Silverlight 4 Tools for Visual Studio 2010, and one of the following editions of Microsoft Visual Studio development system: Visual Studio 2010 Professional, Premium, or Ultimate, Visual Basic 2010 Express, Visual C# 2010 Express, or Visual Web Developer 2010 Express.

  • To make voice calls, ensure your audio device is enabled so that you can make voice calls through Lync 2010.

Creating the Silverlight Application

To display presence in a Silverlight application, in Microsoft Visual Studio use the Lync Silverlight Application template to create an application.

Security settings for Microsoft Lync 2010 SDK applications require that the host URL for Lync Control Silverlight applications be added to the Trusted sites list in Microsoft Internet Explorer. For information about adding to the Trusted sites list, see Working with Internet Explorer 6 Security Settings.

To create the Silverlight walkthrough application

  1. Sign in to Lync 2010.

  2. In Visual Studio, on the Filemenu point to Newand then click Project.

  3. In the New Projectdialog box, in the Installed Templatespane, expand Visual C# and then click Silverlight. In the center pane, click Lync Silverlight Application.

  4. In the Nameand Locationboxes, enter a name and path for the project and then click OK.

  5. In the New Silverlight Applicationdialog box, clear the Host the Silverlight application in a new Web sitecheck box, and then click OK.

  6. In Page.xaml, in the XAML pane, find the PresenceIndicator control and edit the Source property to provide a valid value.

  7. Build and run the application.

  8. On the Web page, the PresenceIndicator control displays presence for the contact specified by the Source property.

Creating the WPF Application

To display presence in a WPF application, in Microsoft Visual Studio use the Lync WPF Application template to create an application.

To create the WPF walkthrough application

  1. In the previous procedure, follow steps 1 and 3. In step 4, in the Installed Templatespane, expand Visual C# and then click Windows. In the center pane, click Lync WPF Application.

  2. In the Nameand Locationboxes, enter a name and path for the project and then click OK.

  3. In Window1.xaml, in the XAML pane, find the PresenceIndicator control and edit the Source property to provide a valid value.

  4. Build and run the application.

  5. In the active window, the PresenceIndicator control displays presence for the contact specified by the Source property.

See Also