TextSearch.TextPath 附加屬性

定義

取得或設定可識別控制項集合中每個項目的項目屬性名稱。

see GetTextPath, and SetTextPath
see GetTextPath, and SetTextPath
see GetTextPath, and SetTextPath

範例

下列範例會建立 , ComboBox 其中包含影像做為專案,而不是文字。 屬性 IsEditable 會設定為 true ,因此選取其中一個影像時會顯示文字。

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

備註

在包含專案集合的控制項上使用這個屬性。 指定屬性的值是使用者可以輸入以選取專案的文字,以及控制項設定為在其 中顯示文字時 TextBox 所顯示的文字。 如果您在控制項的集合專案上設定 Text 屬性, TextPath 則會忽略 屬性。 如果您將 TextPath 屬性設定為不是實際屬性名稱的值, TextPath 則會忽略。

相依性屬性資訊

識別碼欄位 TextPathProperty
設定為 的中繼資料屬性 true

適用於

另請參閱