How to: Display a customized list of team contacts in Lync SDK

Learn how to use the CustomContactList control in Microsoft Lync Control applications to display an arbitrary customized list of contacts, using Microsoft Silverlight or Microsoft Windows Presentation Foundation (WPF). Each item in the contacts list is provided by a CustomContactListItem control.

Applies to: Lync 2013 | Lync Server 2013

In this article
Prerequisites
Display a custom contact list on a Silverlight page
Create a WPF page
Code example: Custom contact group page
Additional resources

Code samples

Customize the contact list view in a WPF application

Prerequisites

The prerequisites for displaying a custom contact list are as follows:

  • Microsoft Lync 2013 SDK.

  • An available Microsoft Lync Server 2013 to sign a user in to.

  • Microsoft Lync 2013.

  • Supported operating systems: Microsoft Windows Vista, Microsoft Windows 7, Microsoft Windows 8, Microsoft Windows Server 2003, or Microsoft Windows Server 2008.

  • Microsoft Silverlight 4 SDK and Microsoft .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 , Visual Studio 2012, or Visual C# 2010 Express.

  • For Silverlight applications: Microsoft Internet Explorer 7, Internet Explorer 8, or Internet Explorer 9. Microsoft Silverlight 4 Tools for Visual Studio 2010 and one of the following editions of Microsoft Visual Studio development system: Visual Studio 2010, Visual Basic 2010 Express, Visual Studio 2012, 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.

Display a custom contact list on a Silverlight page

To create a Silverlight page

  1. Use the Lync Silverlight Application template to create a new Microsoft Silverlight Lync Control application.

    For more information, see How to: Create a Silverlight page that displays a Lync presence control.

  2. In Page.xaml, replace the contents of the Grid control with the following XAML.

    <StackPanel>
      <controls:CustomContactList Height="300" ContactLayoutView="TwoLines">
          <controls:CustomContactListItem Source="sip:elise@contoso.com"/>
          <controls:CustomContactListItem Source="tel:12065550100"/>
          <controls:CustomContactListItem Source="administrators@contoso.com"/>
      </controls:CustomContactList>
    </StackPanel>
    
  3. Edit the Source properties on the CustomContactListItem controls to provide valid values.

  4. Build and run the application.

    The Web page displays three contacts.

Create a WPF page

To create a WPF walkthrough application

  1. Use the Lync WPF Application template to create a new WPF Lync Control application.

    For more information, see How to: Create a Silverlight page that displays a Lync presence control.

  2. Edit the Window1.xaml page as described in step 2 in the previous procedure, and then follow steps 3 and 4 in that procedure.

Code example: Custom contact group page

The following example declares a WPF page that contains a Microsoft.Lync.Controls.CustomContactList that includes several nested Microsoft.Lync.Controls.CustomContactListItem objects.

<Window x:Class="LyncWpfApplication2.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:Microsoft.Lync.Controls;assembly=Microsoft.Lync.Controls"
    Title="Custom Contact List - my work group" Height="Auto" Width="Auto">
    <Grid>
        <StackPanel>
            <controls:CustomContactList Height="300" ContactLayoutView="TwoLines">
                <controls:CustomContactListItem Source="sip:elise@contoso.com"/>
                <controls:CustomContactListItem Source="tel:12065550100"/>
                <controls:CustomContactListItem Source="administrators@contoso.com"/>
            </controls:CustomContactList>
        </StackPanel>
    </Grid>

</Window>

See also