The CustomContactList uses a variety of 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 listed here; one template for the Name View, and one template for the Picture View. These views are sometimes referred to as OneLine and TwoLines view, respectively

To customize the DataTemplate for one or more of these views

  1. The template for a contact within the CustomContactList is applied to a control called CustomContactListItem . This control is not directly accessible from the CustomContactList template. In order to get a copy of the template for a CustomContactListItem, you must temporarily add an instance of the control to your form, and follow the normal steps to edit a copy of its template.

      Copy imageCopy Code
    <controls:CustomContactListItem/> <!-- For temporary use
    -->
    
  2. After you make a copy of the template, you can delete this control from your form.

  3. In the resulting set of resources, you will find many styles and templates that are used by the CustomContactListItem control. Among them, you will find various DataTemplate objects which can be used to customize the appearance of contacts in the CustomContactList.

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

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

The following table identifies the full set of templates which can be used to customize the appearance of contacts in the CustomContactList:

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