This topic demonstrates how to use the Microsoft Lync Control  ContextualInformation property to add the sender's context to an instant messaging (IM) conversation, using Microsoft Silverlight or Microsoft Windows Presentation Foundation (WPF).

Use contextual conversation to increase productivity by capturing the message sender's context and setting up the receiver's context. Adding context to the message in this way streamlines communication by allowing call participants to get on the same page quicker. Context is transmitted as a data structure that is composed of one or more pieces of contextual information. Context can be delivered as a conversation subject line or as application data. In its simplest form, it consists of a subject string and/or a contextual link that appears on the recipient's conversation invite. Contextual data can also include an application ID with associated application data. For more information, see Contextual Conversations .

Prerequisites

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

Creating the Walkthrough Application

The following procedure works for both Silverlight and WPF applications.

To create the contextual conversation walkthrough application

  1. Create the application. For more information, in Walkthrough: Presence Hello World , see "Creating the Silverlight Application" and "Creating the WPF Application." The following instructions assume this is a unified communications WPF application, but the information can be used with other application types.

  2. In Window1.xaml, add the following XAML.

      Copy imageCopy Code
    <StackPanel>
      <StackPanel.Resources>
    	<controls:ConversationContextualInfo 
    	x:Key="contextualInfo" 
    	ApplicationId="{}{21224942-AC24-4D0D-B0C7-6107D79448DF}"
    	ApplicationData="your application data here"
    	ContextualLink="http://microsoft.com"
    	Subject="Try out this customized subject!"
    	/>
      </StackPanel.Resources>
    	<controls:StartInstantMessagingButton 
    	x:Name="startInstantMessaging"
    	Source="sip:barbara@contoso.com"
    	ContextualInformation="{StaticResource contextualInfo}"
    	/>
    </StackPanel>
    
  3. Edit the Source property on the StartInstantMessagingButton control to provide a valid value.

  4. Build and run the application.

  5. Click the StartInstantMessagingButton control.

  6. Enter message text in the conversation window and then press ENTER. A conversation window appears.

  7. In the conversation window, the following message appears and a URL provided by the ContextualLink property is appended to the message: A contextual link has been provided with this conversation. If the link below looks suspicious do not click on it.

See Also