Use the ContactSearchInputBox control to enable users to search their organization for people based on name, phone number, or skill. The ContactSearchInputBox control displays a text box where users enter a search string. The search is executed automatically, one second after the search text is changed, or explicitly when the user presses Enter in the ContactSearchInputBox. Once a search is complete, the results appear in a ContactSearchResultList control.

The ContactSearchInputBox and ContactSearchResultList controls, while related, are designed as separate controls to allow the developer to display search results and search input in separate locations on a page. Use the ContactSearch control in Microsoft Lync Control applications to display the ContactSearchInputBox and ContactSearchResultList controls together in the same location on a page.

ContactSearchInputBox Control

Members

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

Important note Important

The Results property may contain Lync 2010 API objects. The ContactSearchInputBox control maintains these Lync 2010 API objects and discards them when a new search is started or a search is cleared. If an application stores the Results property, it must manage the existing references to the discarded Lync 2010 API objects.

Property or Event

Description

Results property

Gets a SearchResultCollection containing the results of the last completed search.

IsClearEnabled property

Gets a bool value which specifies the visibility of the clear search button. This button is enabled whenever there is a value in the search text input box.

IsSkillSearchEnabled property

Gets a bool value which indicates whether the skill search feature is enabled.

SearchState property

Gets an enumeration value which indicates the current state of the search operation. Valid values are Cleared, Searching, Finished, and Error.

SearchTextInput property

Gets or sets a value which sets the current search criteria. When this property is set, any pending search operation is cancelled, the search results are reset, and a new search operation is invoked with the given criteria. If this value is set to null, the pending search operation is cancelled, the search results are reset, and the control returns to an idle Cleared state.

SearchType property

Gets or sets an enumerated value that represents the search type. The type is a SearchType enumeration. Possible values:

  • Name

  • Skill

MaxResults property

Gets or sets the maximum number of results to return.

Code Example

The following example can be used for Microsoft Silverlight and Microsoft Windows Presentation Foundation (WPF) application development.

  Copy imageCopy Code
<StackPanel>
  <controls:ContactSearchInputBox x:Name="searchInput"/>
  <controls:ContactSearchResultList
	ItemsSource="{Binding Results, ElementName=searchInput,
Mode=OneWay}"
	ResultsState="{Binding SearchState, ElementName=searchInput,
Mode=OneWay}"/>
</StackPanel>

See Also

Other Resources