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
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 -->
After you save a copy of the template, delete CustomContactListItem from your form.
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 |
PersonContactItemDataTemplateOneLine |
|
Person |
TwoLines |
PersonContactItemDataTemplateTwoLines |
|
Telephone |
OneLine |
TelephoneContactItemDataTemplateOneLine |
|
Telephone |
TwoLines |
TelephoneContactItemDataTemplateTwoLines |
|
Bot |
OneLine |
BotContactItemDataTemplateOneLine |
|
Bot |
TwoLines |
BotContactItemDataTemplateTwoLines |
|
Group |
OneLine |
GroupContactItemDataTemplateOneLine |
|
Group |
TwoLines |
GroupContactItemDataTemplateTwoLines |