The PresenceIndicator control displays one of several icons that indicate the presence of a given user. It is a stand-alone control representing a single contact, and enables access to the quick connect menu and the contact card for the user. The control also can display a photo for the given user. The following images display different options for the PhotoDisplayMode property. When the Source property is not set, or when no photo is available, a stock silhouette image is used as shown below.

PresenceIndicator Control

PresenceIndicator Control

Quick Connect Menu

The control reacts to two user actions: hover and click. When a user hovers over the icon, after about one second the quick connect menu appears. The quick connect menu displays the contact's presence, starts IM, e-mail, or audio calls, and can be expanded to show detailed contact information. The quick connect menu disappears if it is not used. The user can keep the quick connect menu open by pinning it.

ContactCard

Members

Notable PresenceIndicator control public properties and events relating to unified communications appear in the following table. For a full list, see Lync 2010 API Class Library documentation.

Property or Event

Description

Source property

Gets or sets the contact to display. Valid types include Contact and DistributionGroup objects, and String.

  • If the value is a string which does not contain the sip: or tel: prefix, the control will perform a search, using the string specified as a search criteria, and will load the first contact in the result set matching the specified string. This behavior is not deterministic, and yields the slowest performance.

  • If the value is a SIP URI string qualified by the sip: or tel: prefix, the contact will be loaded using an exact match of the specified URI. This behavior is deterministic, and yields better performance.

  • If the value is a Contact or DistributionGroup object, it will be used without changes. This behavior is deterministic, and yields the best performance.

ActivityStatus property

Gets the presence status string for the contact. For example, In a meetingor Away. For groups this is an empty string.

DisplayName property

Gets the contact's display name.

ContextualInformation property

Gets or sets a data structure which contains information used to customize the information that accompanies messages. For more information about the use of contextual information, see Contextual Conversations .

Model property

Reserved for internal use. When editing templates, this property may appear in XAML text. To preserve control functionality it should remain static.

AvailabilityState property

Gets an enumerated value that represents the contact's availability. The type is a ContactAvailability enumeration. Possible values:

  • Invalid

  • None

  • Free

  • FreeIdle

  • Busy

  • BusyIdle

  • DoNotDisturb

  • TemporarilyAway

  • Away

  • Offline

HoverAction property

Gets or sets an enumeration value that determines the contact card display mode when the cursor hovers over the presence icon. The default is ShowContactBrief.

SingleClickAction property

Gets or sets an enumeration value that determines the contact card display mode after the presence icon is clicked. The default is ShowContactDetails.

PhotoDisplayMode property

Gets or sets an enumeration value that determines the presence photo display mode. The default is Hidden.

Code Example

Sample code for Microsoft Silverlight and Microsoft Windows Presentation Foundation (WPF) appears in the following section.

  Copy imageCopy Code
<StackPanel>
  <controls:PresenceIndicator Source="sip:mary@contoso.com"/>
</StackPanel>

See Also

Other Resources