Windows Store app - how to get a watermark in the "Search in Search" text box

I fulfilled the search contract in my Windows 8 application.

However, when the user invokes the charm of searching from the application, the search box is initially empty. I noticed that other applications use a watermark by default, for example, the Bing Maps application:

enter image description here

How can I reproduce this behavior and add my own watermark?

+4
source share
1 answer

Well, it is not documented on the main page of the quick launch or the search rule , but you do it as follows:

protected override async void OnWindowCreated(WindowCreatedEventArgs args) { SearchPane sp = SearchPane.GetForCurrentView(); sp.PlaceholderText = "Enter the name of a town or city"; } 

I suggest putting it in the OnWindowCreated (...) method in App.xaml.cs

+3
source

Source: https://habr.com/ru/post/1438699/


All Articles