我已在我的Windows 8应用程序中实现了搜索合同。 然而,当用户从应用程序内部调出搜索窗口时,搜索框最初是空白的。 我注意到其他应用程序在框内有默认的“水印”,例如必应地图应用程序: 我该如何重现此行为并添加自己的水印?
好的,这并没有在主要入门指南页面或搜索指南中记录,但您可以按照以下方式进行: protected override async void OnWindowCreated(WindowCreatedEventArgs args) { SearchPane sp = SearchPane.GetForCurrentView(); sp.PlaceholderText = "Enter the name of a town or city"; } 我建议将它放置在App.xaml.cs文件中的OnWindowCreated(...)方法中。