TextSearch.TextPath Attached Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the name of the items' property that identifies each item in a control's collection.
see GetTextPath, and SetTextPath
see GetTextPath, and SetTextPath
see GetTextPath, and SetTextPath
Examples
The following example creates a ComboBox that contains images as items instead of text. The IsEditable property is set to true
, so text is displayed when one of the images is selected.
<ComboBox IsEditable="true" TextSearch.TextPath="Name">
<Image Name="Cat" Source="data\cat.png"/>
<Image Name="Dog" Source="data\dog.png"/>
<Image Name="Fish" Source="data\fish.png"/>
</ComboBox>
Remarks
Use this property on a control that contains a collection of items. The value of the specified property is the text that the user can type to select the item, and the text that is displayed if the control is set to display text in its TextBox. If you set the Text property on a control's collection item, the TextPath property will be ignored. If you set the TextPath property to a value that is not the name of an actual property, TextPath is ignored.
Dependency Property Information
Identifier field | TextPathProperty |
Metadata properties set to true |
None |
Applies to
See also
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應