Windows应用商店应用 - 如何在搜索超级按钮文本框中获取水印

时间:2012-10-09 16:29:23

标签: c# .net windows-8 windows-runtime

我在Windows 8应用程序中实现了搜索合同。

但是,当用户从应用程序中调出搜索超级按钮时,搜索框最初是空白的。我注意到其他应用程序在框中有默认的“水印”,例如Bing Maps应用程序:

enter image description here

如何重现此行为并添加自己的水印?

1 个答案:

答案 0 :(得分:3)

好的,它没有记录在main Quickstart pagesearch guidelines上,但是你这样做了:

    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(...)方法

相关问题