Compartilhar via


PresenceIndicator Control

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 can also 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 appears in the UI.

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 that are related to unified communications appear in the following table. For more information, see Lync 2010 Class Libraries References.

Property

Description

Source

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, by 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

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

DisplayName

Gets the contact’s display name.

ContextualInformation

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 Lync Extensibility API Contextual Conversations (Lync 2010 SDK).

Model

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

AvailabilityState

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

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

SingleClickAction

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

PhotoDisplayMode

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

Code Example

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

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

See Also

Other Resources

Lync 2010 Controls Reference

Lync 2010 Controls