Partager via


ContactSearchInputBox Control

Use the ContactSearchInputBox control in Microsoft Lync 2010 Control applications 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 Lync 2010 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 that relate to unified communications appear in the following table. For more information, see Lync 2010 Class Libraries References.

Important

The Results property may contain Microsoft 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

Description

Results

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

IsClearEnabled

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

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

SearchState

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

SearchTextInput

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

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

  • Name

  • Skill

MaxResults

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.

<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

Lync 2010 Controls Reference

Lync 2010 Controls