在AutoSuggestBox中浏览建议时显示占位符

问题描述 投票:0回答:1

当用户在AutoSuggestBox建议列表中导航时,是否可以显示占位符(我的意思是,在文本框中不显示任何选定的项目?它与Windows 10 weather app的功能类似,当用户从搜索框列表中选择一项时,它将在文本框中显示占位符。

c# xaml uwp win-universal-app windows-10-desktop
1个回答
0
投票

在浏览AutoSuggestBox中的建议时显示占位符

当然,AutoSuggestBox包含AutoSuggestBox属性,您可以将其设置为值或使用c绑定值。

PlaceholderText

[当用户从搜索框列表中选择一项时,它将在文本框中显示占位符

AutoSuggestBox将在建议列表中选择选项时自动填充PlaceholderText内容(<AutoSuggestBox PlaceholderText="string"/> ),但不是TextBox。如果您此时确实想更改UpdateTextOnSelect,则可以将UpdateTextOnSelect设置为UpdateTextOnSelect并检测到AutoSuggestBox PlaceholderText事件,然后在此处设置PlaceholderText

False
© www.soinside.com 2019 - 2024. All rights reserved.