TextSearch.TextPath Attached Property
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Gets or sets the name of the items' property that identifies each item in a control's collection.
Assembly: System.Windows (in System.Windows.dll)
'Declaration See GetTextPath, SetTextPath
See GetTextPath, SetTextPath
The name of the property that contains the text that identifies the item to the user. The default value is an empty string.
Use the TextPath property to associate strings with ItemsControl items for search purposes. For example, if a ListBox contains a collection of Image objects, you can set the TextPath property to “Name”. Then if you set the Name value for one of the images to "dog", the user could select that image by typing “dog” in the ListBox. When the user types enough of the word to distinguish it from other items in the collection, the dog item is selected and displays in the ListBox.
In addition to using the TextPath property, the system will try to obtain a string for search purposes in the following order:
The DisplayMemberPath property if set and resolvable.
The Text property if the item is a ContentControl that contains a text control.
The search is always case-insensitive.
Supported in: 5
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.