This topic demonstrates how to use the ContactCard control in Microsoft Lync Control applications to display contact and organization information for multiple contacts, using Microsoft Silverlight or Microsoft Windows Presentation Foundation (WPF).

Prerequisites

For a list of prerequisites, see Walkthrough: Presence Hello World .

Creating the Silverlight Application

Use a Grid as a container for a group of ContactCard controls.

To create the Silverlight walkthrough application

  1. Create a Lync Controls application using the Lync Silverlight Application template. For more information, see the topic Walkthrough: Presence Hello World .

  2. In Page.xaml, replace the existing Grid control with the following example XAML text. Edit the Name and Source properties to provide valid values.

      Copy imageCopy Code
    <Grid>
     <Grid.ColumnDefinitions>
      <ColumnDefinition/>
      <ColumnDefinition/>
      </Grid.ColumnDefinitions>
     <Grid.RowDefinitions>
      <RowDefinition/>
      <RowDefinition/>
     </Grid.RowDefinitions>
     <controls:ContactCard x:Name="contact0"  IsExpanded="False"
    Source="sip:elise@contoso.com" Grid.Column="0" Grid.Row="0"/>
     <controls:ContactCard x:Name="contact1"  IsExpanded="False"
    Source="sip:robert@contoso.com" Grid.Column="0" Grid.Row="1"/>
     <controls:ContactCard x:Name="contact3"  IsExpanded="False"
    Source="sip:mary@contoso.com" Grid.Column="1" Grid.Row="0"/>
     <controls:ContactCard x:Name="contact4"  IsExpanded="False"
    Source="sip:john@contoso.com" Grid.Column="1" Grid.Row="1"/>
    </Grid>
    
  3. Build and run the application.

  4. In the Web page, the four contact cards appear.

Creating the WPF Application

Use a Grid as a container for a group of ContactCard controls.

To create the WPF walkthrough application

  1. Create a Lync Controls application using the Lync WPF Application template. For more information, see the topic Walkthrough: Presence Hello World .

  2. In Window1.xaml, replace the existing Grid control with the example XAML text from step 2 in the previous procedure, edit the XAML, and then complete the remaining steps as described in that procedure.

See Also

Other Resources