Partager via


Walkthrough: Presence Hello World

This walkthrough and the accompanying video show how to add a PresenceIndicator control to Microsoft Lync 2010 Control applications, by 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, make sure that 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 how to add to the Trusted sites list, see Working with Internet Explorer 6 Security Settings Only Microsoft Internet Explorer 7 and later versions of Internet Explorer support Lync 2010 Silverlight controls.

To create the Silverlight walkthrough application

  1. Sign in to Lync 2010.

  2. In Visual Studio, on the File menu point to New and then click Project.

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

  4. In the Name and Location boxes, enter a name and path for the project and then click OK.

  5. In the New Silverlight Application dialog box, clear the Host the Silverlight application in a new Web site check 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 webpage, 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 through 3. In step 4, in the Installed Templates pane, expand Visual C# and then click Windows. In the center pane, click Lync WPF Application.

  2. In the Name and Location boxes, 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

Concepts

Understand the Lync 2010 SDK Source Property

Walkthrough: Use the Source Property

Other Resources

Video: Add Presence to a WPF Application

Lync 2010 Controls Walkthroughs