Compartir a través de


Retemplating the Lync 2010 CustomContactList Control

Learn how to retemplate the Microsoft Lync 2010 CustomContactList control.

The CustomContactList control uses different DataTemplate resources to control the appearance of people, telephone numbers, bots, and distribution lists. There are two data templates for each type of contact:

  • Name View template

  • Picture View template

These views are sometimes referred to as OneLine and TwoLines view, respectively.

To customize the DataTemplate for one or more view

  1. The template for a contact within the CustomContactList control is applied to a control called CustomContactListItem. CustomContactListItem is not directly accessible from the CustomContactList template. To get a copy of the template for a CustomContactListItem, temporarily add an instance of CustomContactListItem to your form and then edit a copy of its template.

    <controls:CustomContactListItem/> <!-- For temporary use -->
    
  2. After you save a copy of the template, delete CustomContactListItem from your form.

  3. In the resulting set of resources, styles and templates used by the CustomContactListItem control appear. The DataTemplate objects can be used to customize the appearance of contacts in the CustomContactList control.

    For example, you can modify the template used to display person-type contacts in TwoLines view by customizing the data template that is identified by the key PersonContactItemDataTemplateTwoLines template. After you make your changes, apply the new template by setting the following property on the CustomContactList control.

    <controls:CustomContactList PersonTwoLineItemTemplate=
            "{StaticResource PersonContactItemDataTemplateTwoLines}"/>
    

The following table lists the templates that can be used to customize the appearance of contacts in the CustomContactList control.

Contact type

Layout view

ContactList property name

Name of corresponding DataTemplate

Person

OneLine

PersonItemTemplate

PersonContactItemDataTemplateOneLine

Person

TwoLines

PersonTwoLineItemTemplate

PersonContactItemDataTemplateTwoLines

Telephone

OneLine

TelephoneItemTemplate

TelephoneContactItemDataTemplateOneLine

Telephone

TwoLines

TelephoneTwoLineItemTemplate

TelephoneContactItemDataTemplateTwoLines

Bot

OneLine

BotItemTemplate

BotContactItemDataTemplateOneLine

Bot

TwoLines

BotTwoLineItemTemplate

BotContactItemDataTemplateTwoLines

Group

OneLine

GroupItemTemplate

GroupContactItemDataTemplateOneLine

Group

TwoLines

GroupTwoLineItemTemplate

GroupContactItemDataTemplateTwoLines

See Also

Concepts

Retemplating Lync 2010 Controls That Use ContentPresenters

Retemplating Lync 2010 Controls