Sdílet prostřednictvím


Walkthrough: Start a Contextual Conversation in an IM Call

This walkthrough and the accompanying video show how to use the Microsoft Lync 2010 Controls ContextualInformation property to add the sender’s context to an instant messaging (IM) conversation, by 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 manner streamlines communication by letting call participants reach the same page in less time. 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 a contextual link that appears on the recipient’s conversation invite or without a contextual link. Contextual data can also include an application ID with associated application data. For more information, see Lync Extensibility API Contextual Conversations (Lync 2010 SDK).

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.

    Note

    The empty braces in the ApplicationId property escape the following ‘{’.

    <StackPanel>
      <StackPanel.Resources>
        <controls:ConversationContextualInfo 
          x:Key="contextualInfo" 
          ApplicationId="{}{21224942-AC24-4D0D-B0C7-6107D79448DF}"
          ApplicationData="your application data here"
    
          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. Install and register the application on the sending and receiving computers. For information about contextual application registration, see Register Contextual Conversation Packages in Lync 2010.

  5. Build and run the application.

  6. Click the StartInstantMessagingButton control.

  7. Enter message text in the conversation window and then press ENTER.

  8. On the receiving computer, use the GetApplicationData method to retrieve the data, or trap one of the Conversation object events.

See Also

Other Resources

Video: Lync Contextual Data Part 1: Send Data With An IM Message

Lync 2010 Controls Walkthroughs

Lync Extensibility API Contextual Conversations (Lync 2010 SDK)